Skip to content

Commit

Permalink
Filter: Select2 now adheres to case sensitivity setting. See #1237
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Jun 28, 2016
1 parent eb84f87 commit 9e6802d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/js/widgets/widget-filter-formatter-select2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion js/widgets/widget-filter-formatter-select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
$shcell = [],
matchPrefix = o.match ? '' : '^',
matchSuffix = o.match ? '' : '$',
flags = wo.filter_ignoreCase ? 'i' : '',

// this function updates the hidden input and adds the current values to the header cell text
updateSelect2 = function() {
Expand All @@ -60,7 +61,11 @@
}
$input
// add regex, so we filter exact numbers
.val( $.isArray(v) && v.length && v.join('') !== '' ? '/(' + matchPrefix + (v || []).join(matchSuffix + '|' + matchPrefix) + matchSuffix + ')/' : '' )
.val(
$.isArray(v) && v.length && v.join('') !== '' ?
'/(' + matchPrefix + (v || []).join(matchSuffix + '|' + matchPrefix) + matchSuffix + ')/' + flags :
''
)
.trigger('search').end()
.find('.select2').select2('val', v);
// update sticky header cell
Expand Down

0 comments on commit 9e6802d

Please sign in to comment.