From f67b4c6e6045cf4e9f7ee5e3d222372baae88405 Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Sun, 14 Feb 2016 07:55:14 -0500 Subject: [PATCH] Improve selectizer options by allowing multi-select lists and control over some more options: - `maxOptions`: using `data-max-options` - `maxItems`: using `data-max-items` - `hideSelected`: using `data-hide-selected` - `closeAfterSelect`: using `data-close-after-select` --- webroot/js/local.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webroot/js/local.js b/webroot/js/local.js index 712db348..9451a44b 100644 --- a/webroot/js/local.js +++ b/webroot/js/local.js @@ -41,8 +41,11 @@ $(document).on('ready', function() { $('input.autocomplete, select.autocomplete').each(function (i, e) { e = $(e); e.selectize({ - maxItems: 1, - create: !$(e).data('exact-match'), + maxItems: e.data('max-items') || 1, + maxOptions: e.data('max-options') || 10, + hideSelected: e.data('hide-selected'), + closeAfterSelect: e.data('close-after-select'), + create: !e.data('exact-match'), persist: false, render: { 'option_create': function(data, escape) {