-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
This is not a Pull request, but just an optional suggestion.
Depending on the number of options, we may use different types of List field. For example, if the number of options is less than 10 or so, use a checkbox, if more, use a drop-down list.
If the List field is a drop-down list with multiple options, I believe select2 is more convenient. So I tried to modify the local source code as following.
diff --git a/assets/javascripts/searchable_selectbox.js b/assets/javascripts/searchable_selectbox.js
index dedb790..50324b7 100644
--- a/assets/javascripts/searchable_selectbox.js
+++ b/assets/javascripts/searchable_selectbox.js
@@ -70,7 +70,7 @@ function replaceSelect2() {
if ($('body').hasClass('controller-workflows')) {
return;
} else {
- var selectInTabular = $('.tabular .splitcontent select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');
+ var selectInTabular = $('.tabular .splitcontent select:not([check_box_group]):not([data-remote]):not(.select2-hidden-accessible)');
if (selectInTabular.length) {
selectInTabular.select2({
width: 'style'
@@ -79,7 +79,7 @@ function replaceSelect2() {
});
}
- var other = $('select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');
+ var other = $('select:not([check_box_group]):not([data-remote]):not(.select2-hidden-accessible)');
if (other.length) {
other.select2().on('select2:select', function() {
retriggerChangeIfNativeEventExists($(this));
ishikawa999
Metadata
Metadata
Assignees
Labels
No labels