Skip to content

Commit 064a5b9

Browse files
committed
Update init.js
1 parent 76765ce commit 064a5b9

File tree

1 file changed

+6
-1
lines changed
  • app/assets/javascripts/active_admin/searchable_select

1 file changed

+6
-1
lines changed

app/assets/javascripts/active_admin/searchable_select/init.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
// reading from data allows <input data-searchable_select='{"tags": ['some']}'>
77
// to be passed to select2
88
var options = $.extend(extra || {}, item.data('searchableSelect'));
9+
10+
// default option allow clear
11+
if (options.allowClear != undefined)
12+
options.allowClear: true
13+
914
var url = item.data('ajaxUrl');
1015

1116
if (url) {
@@ -43,4 +48,4 @@
4348
$(function() {
4449
initSearchableSelects($(".searchable-select-input"));
4550
});
46-
}());
51+
}());

0 commit comments

Comments
 (0)