Fix wrong method call, breaking tests on Firefox

`Array.prototype.each()` is not a native JavaScript method:
`Array.prototype.forEach()` is the correct method.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/1390/head
Alex Coles 11 years ago
parent c151a9e266
commit 8d8584adbc
  1. 13
      app/assets/javascripts/timelines_select_boxes.js

@ -39,7 +39,7 @@ jQuery(document).ready(function($) {
$("#timeline_options_grouping_two_sort"), $("#timeline_options_grouping_two_sort"),
$("#timeline_options_planning_element_time_relative_one_unit"), $("#timeline_options_planning_element_time_relative_one_unit"),
$("#timeline_options_planning_element_time_relative_two_unit") $("#timeline_options_planning_element_time_relative_two_unit")
].each(function (item) { ].forEach(function (item) {
$("input[name='" + $(item).attr("name")+"']").remove(); $("input[name='" + $(item).attr("name")+"']").remove();
$(item).select2({ $(item).select2({
@ -69,7 +69,7 @@ jQuery(document).ready(function($) {
$("#timeline_options_planning_element_responsibles"), $("#timeline_options_planning_element_responsibles"),
$("#timeline_options_planning_element_assignee"), $("#timeline_options_planning_element_assignee"),
$("#timeline_options_grouping_two_selection") $("#timeline_options_grouping_two_selection")
].each(function (item) { ].forEach(function (item) {
$(item).autocomplete({ multiple: true, $(item).autocomplete({ multiple: true,
ajax: {null_element: {id: -1, name: I18n.t("js.filter.noneElement")}} ajax: {null_element: {id: -1, name: I18n.t("js.filter.noneElement")}}
}); });
@ -79,7 +79,7 @@ jQuery(document).ready(function($) {
$("#timeline_options_planning_element_types"), $("#timeline_options_planning_element_types"),
$("#timeline_options_planning_element_time_types"), $("#timeline_options_planning_element_time_types"),
$("#timeline_options_planning_element_status") $("#timeline_options_planning_element_status")
].each(function (item) { ].forEach(function (item) {
$(item).autocomplete({ $(item).autocomplete({
multiple: true multiple: true
}); });
@ -94,7 +94,7 @@ jQuery(document).ready(function($) {
[ [
$("#reporting_reporting_to_project_id"), $("#reporting_reporting_to_project_id"),
$("#project_association_select_project_b_id") $("#project_association_select_project_b_id")
].each(function (item) { ].forEach(function (item) {
// Stuff borrowed from Core application.js Project Jump Box // Stuff borrowed from Core application.js Project Jump Box
$(item).autocomplete({ $(item).autocomplete({
multiple: false, multiple: false,
@ -112,7 +112,7 @@ jQuery(document).ready(function($) {
[ [
$("#timeline_options_grouping_one_selection") $("#timeline_options_grouping_one_selection")
].each(function (item) { ].forEach(function (item) {
// Stuff borrowed from Core application.js Project Jump Box // Stuff borrowed from Core application.js Project Jump Box
$(item).autocomplete({ $(item).autocomplete({
multiple: true, multiple: true,
@ -131,7 +131,7 @@ jQuery(document).ready(function($) {
[ [
$("#timeline_options_parents") $("#timeline_options_parents")
].each(function (item) { ].forEach(function (item) {
// Stuff borrowed from Core application.js Project Jump Box // Stuff borrowed from Core application.js Project Jump Box
$(item).autocomplete({ $(item).autocomplete({
multiple: true, multiple: true,
@ -168,4 +168,3 @@ jQuery(document).ready(function($) {
field.closest("fieldset").removeClass('collapsed').children("div").show(); field.closest("fieldset").removeClass('collapsed').children("div").show();
} }
}); });

Loading…
Cancel
Save