diff options
author | Go MAEDA <maeda@farend.jp> | 2024-09-12 01:55:53 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-09-12 01:55:53 +0000 |
commit | 1d214102c3791740bab24426fe668150f82e7442 (patch) | |
tree | 8d1e811cce741a0d50fd2b8b69c142be14252997 | |
parent | d20c8ef26eb80866ba33c5c7cf5c618ed75e809d (diff) | |
download | redmine-1d214102c3791740bab24426fe668150f82e7442.tar.gz redmine-1d214102c3791740bab24426fe668150f82e7442.zip |
Revert r23046 (#32523).
The change broke filters.
git-svn-id: https://svn.redmine.org/redmine/trunk@23054 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/assets/javascripts/application.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d0b601285..4560bff09 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -185,7 +185,7 @@ function buildFilterRow(field, operator, values) { if (!filterOptions) return; var operators = operatorByType[filterOptions['type']]; var filterValues = filterOptions['values']; - var select; + var i, select; var tr = $('<div class="filter">').attr('id', 'tr_'+fieldId).html( '<div class="field"><input checked="checked" id="cb_'+fieldId+'" name="f[]" value="'+field+'" type="checkbox"><label for="cb_'+fieldId+'"> '+filterOptions['name']+'</label></div>' + @@ -195,11 +195,11 @@ function buildFilterRow(field, operator, values) { filterTable.append(tr); select = tr.find('.operator select'); - operators.forEach(function(op) { - var option = $('<option>').val(op).text(operatorLabels[op]); - if (op == operator) { option.prop('selected', true); } + for (i = 0; i < operators.length; i++) { + var option = $('<option>').val(operators[i]).text(operatorLabels[operators[i]]); + if (operators[i] == operator) { option.prop('selected', true); } select.append(option); - }); + } select.change(function(){ toggleOperator(field); }); switch (filterOptions['type']) { @@ -215,7 +215,7 @@ function buildFilterRow(field, operator, values) { ); select = tr.find('.values select'); if (values.length > 1) { select.attr('multiple', true); } - filterValues.forEach(function(filterValue) { + for (i = 0; i < filterValues.length; i++) { var filterValue = filterValues[i]; var option = $('<option>'); if ($.isArray(filterValue)) { @@ -231,7 +231,7 @@ function buildFilterRow(field, operator, values) { if ($.inArray(filterValue, values) > -1) {option.prop('selected', true);} } select.append(option); - }); + } break; case "date": case "date_past": @@ -259,13 +259,13 @@ function buildFilterRow(field, operator, values) { ); $('#values_'+fieldId).val(values[0]); select = tr.find('.values select'); - filterValues.forEach(function(filterValue) { + for (i = 0; i < filterValues.length; i++) { var filterValue = filterValues[i]; var option = $('<option>'); option.val(filterValue[1]).text(filterValue[0]); if (values[0] == filterValue[1]) { option.prop('selected', true); } select.append(option); - }); + } break; case "integer": case "float": |