From de1730b2b6f4ea950b66e82a5161b68c87680eb8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 1 Feb 2017 12:22:36 -0800 Subject: [PATCH] Selectize styling --- e107_handlers/form_handler.php | 11 +++++++---- e107_themes/bootstrap3/admin_style.css | 6 +++++- e107_web/js/selectize/js/selectize.init.js | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 4094c5df8..3a497bba6 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -732,27 +732,28 @@ class e_form } */ - if(vartrue($options['selectize'])) + if(!empty($options['selectize'])) { e107::js('core', 'selectize/js/selectize.min.js', 'jquery'); e107::css('core', 'selectize/css/selectize.css', 'jquery'); if(deftrue('BOOTSTRAP') === 3) { - e107::css('core', 'selectize/css/selectize.bootstrap3.css', 'jquery'); + // e107::css('core', 'selectize/css/selectize.bootstrap3.css', 'jquery'); } elseif(deftrue('BOOTSTRAP')) { - e107::css('core', 'selectize/css/selectize.bootstrap2.css', 'jquery'); + // e107::css('core', 'selectize/css/selectize.bootstrap2.css', 'jquery'); } // Load selectize behavior. e107::js('core', 'selectize/js/selectize.init.js', 'jquery'); $options['selectize']['wrapperClass'] = 'selectize-control'; - $options['selectize']['inputClass'] = 'selectize-input'; + $options['selectize']['inputClass'] = 'selectize-input form-control'; $options['selectize']['dropdownClass'] = 'selectize-dropdown'; $options['selectize']['dropdownContentClass'] = 'selectize-dropdown-content'; + $options['selectize']['copyClassesToDropdown'] = true; $jsSettings = array( 'id' => vartrue($options['id'], $this->name2id($name)), @@ -765,6 +766,8 @@ class e_form // Merge field settings with other selectize field settings. e107::js('settings', array('selectize' => array($jsSettings))); + + $options['class'] = ''; } // TODO: remove typeahead. diff --git a/e107_themes/bootstrap3/admin_style.css b/e107_themes/bootstrap3/admin_style.css index ba54611b5..c0247dcbe 100644 --- a/e107_themes/bootstrap3/admin_style.css +++ b/e107_themes/bootstrap3/admin_style.css @@ -1191,7 +1191,11 @@ li.rssRow > div { .admin-left-panel.toggled { display: none } -/* ######## selectize.js ######## * +/* ######## selectize.js ######## */ + +.selectize-input input { color: inherit } + + /* .selectize-control.single .selectize-input, .selectize-control.single .selectize-input.input-active, diff --git a/e107_web/js/selectize/js/selectize.init.js b/e107_web/js/selectize/js/selectize.init.js index 20b9b49ed..13d385696 100644 --- a/e107_web/js/selectize/js/selectize.init.js +++ b/e107_web/js/selectize/js/selectize.init.js @@ -102,6 +102,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; inputClass: item.options.inputClass || 'selectize-input', dropdownClass: item.options.dropdownClass || 'selectize-dropdown', dropdownContentClass: item.options.dropdownContentClass || 'selectize-dropdown-content', + copyClassesToDropdown: item.options.copyClassesToDropdown ? item.options.copyClassesToDropdown : null, // Callbacks. load: function (query, callback) {