Skip to content

Commit

Permalink
Change select[data-remote] to unsupported #4
Browse files Browse the repository at this point in the history
  • Loading branch information
ishikawa999 committed Oct 26, 2020
1 parent 1aceef2 commit 2ddb11a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assets/javascripts/searchable_selectbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $(function() {
var oldAddFilter = window.addFilter;
window.addFilter = function(field, operator, values){
oldAddFilter(field, operator, values);
$('#filters-table select:not([multiple]):not(.select2-hidden-accessible)').select2();
$('#filters-table select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)').select2();
$('#select2-add_filter_select-container.select2-selection__rendered').text('');
}

Expand All @@ -45,11 +45,11 @@ function replaceSelect2() {
if ($('body').hasClass('controller-workflows')) {
return;
} else {
var selectInTabular = $('.tabular select:not([multiple]):not(.select2-hidden-accessible)');
if (selectInTabular.length) { selectInTabular.select2({ width: '85%' }); }
var selectInTabular = $('.tabular select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');
if (selectInTabular.length) { selectInTabular.select2({ width: '85%' }).on('select2:select', function(){Rails.fire($(this)[0], 'change')}); }

var other = $('select:not([multiple]):not(.select2-hidden-accessible)');
if (other.length) { other.select2(); }
var other = $('select:not([multiple]):not([data-remote]):not(.select2-hidden-accessible)');
if (other.length) { other.select2().on('select2:select', function(){Rails.fire($(this)[0], 'change')}); }

var excludedSelect = $('table.list td>select');
if (excludedSelect.length) { excludedSelect.select2('destroy'); }
Expand Down

0 comments on commit 2ddb11a

Please sign in to comment.