diff --git a/README.md b/README.md index 380f0c0..5509a26 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a plugin for Redmine. This plugin changes Redmine's selectbox searchable. -Replace Redmine selectbox with [Select2 4.0.12](https://select2.org/). +Replace Redmine selectbox with [Select2 4.0.13](https://select2.org/). ## Install diff --git a/assets/javascripts/searchable_selectbox.js b/assets/javascripts/searchable_selectbox.js index e986e63..ebd1bda 100644 --- a/assets/javascripts/searchable_selectbox.js +++ b/assets/javascripts/searchable_selectbox.js @@ -67,34 +67,35 @@ $(function() { function replaceSelect2() { // TODO: Need to support replace of select according to the click event. // Do not replace it with select2 until it corresponds. + // multiselection doesn't work in worflow modification + // so remove minus and plus, yes it's bad if ($('body').hasClass('controller-workflows')) { - return; + $('.toggle-multiselect').remove(); + } + if ($('#template_area').length) { + // This code is for the `Support Built-In / Custom Fields` feature of the redmine_issue_templates plugin. + var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote])'); } else { - if ($('#template_area').length) { - // This code is for the `Support Built-In / Custom Fields` feature of the redmine_issue_templates plugin. - var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote])'); - } else { - var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)'); - } - if (selectInTabular.length) { - selectInTabular.select2({ - width: 'style' - }).on('select2:select', function() { - retriggerChangeIfNativeEventExists($(this)); - }); - } + var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)'); + } + if (selectInTabular.length) { + selectInTabular.select2({ + width: 'style' + }).on('select2:select', function() { + retriggerChangeIfNativeEventExists($(this)); + }); + } - var other = $('select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)'); - if (other.length) { - other.select2().on('select2:select', function() { - retriggerChangeIfNativeEventExists($(this)); - }); - } + var other = $('select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)'); + if (other.length) { + other.select2().on('select2:select', function() { + retriggerChangeIfNativeEventExists($(this)); + }); + } - var excludedSelect = $('table.list td>select'); - if (excludedSelect.length) { - excludedSelect.select2('destroy'); - } + var excludedSelect = $('table.list td>select'); + if (excludedSelect.length) { + excludedSelect.select2('destroy'); } } diff --git a/config/locales/fr.yml b/config/locales/fr.yml new file mode 100644 index 0000000..8ef9816 --- /dev/null +++ b/config/locales/fr.yml @@ -0,0 +1,2 @@ +fr: + label_enable_seachable_selectbox: Activer la recherche sur les listes \ No newline at end of file