Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
49 changes: 25 additions & 24 deletions assets/javascripts/searchable_selectbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fr:
label_enable_seachable_selectbox: Activer la recherche sur les listes