From 5c1b2a1ccfa77f4bd33b3669b1dbba7ff8d87718 Mon Sep 17 00:00:00 2001 From: Manuel van Rijn Date: Thu, 11 Jul 2013 18:42:58 +0200 Subject: [PATCH] version bump to 0.6.4 --- README.md | 1 + lib/selectize-rails/version.rb | 2 +- vendor/assets/javascripts/selectize.js | 661 ++++++++++++------------ vendor/assets/stylesheets/selectize.css | 2 +- 4 files changed, 339 insertions(+), 327 deletions(-) diff --git a/README.md b/README.md index 07eb994..da2f83d 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ See the [demo page of Brian Reavis](http://brianreavis.github.io/selectize.js/) | Version | Notes | | -------:| ----------------------------------------------------------------------------------- | +| 0.6.4 | Update to latest version of selectize.js | | 0.6.1 | Update and set gem version equal to selectize.js version | | 0.1.0 | Initial release | diff --git a/lib/selectize-rails/version.rb b/lib/selectize-rails/version.rb index da03c59..2bdd915 100644 --- a/lib/selectize-rails/version.rb +++ b/lib/selectize-rails/version.rb @@ -1,5 +1,5 @@ module Selectize module Rails - VERSION = "0.6.1" + VERSION = "0.6.4" end end diff --git a/vendor/assets/javascripts/selectize.js b/vendor/assets/javascripts/selectize.js index bc9c380..084dee6 100644 --- a/vendor/assets/javascripts/selectize.js +++ b/vendor/assets/javascripts/selectize.js @@ -1,4 +1,4 @@ -/*! selectize.js - v0.6.1 | https://github.com/brianreavis/selectize.js | Apache License (v2) */ +/*! selectize.js - v0.6.4 | https://github.com/brianreavis/selectize.js | Apache License (v2) */ (function(factory) { if (typeof exports === 'object') { @@ -9,10 +9,10 @@ factory(jQuery); } }(function ($) { - "use strict"; - + "use strict"; + /* --- file: "src/contrib/highlight.js" --- */ - + /** * highlight v3 | MIT license | Johann Burkard * Highlights arbitrary terms in a node. @@ -20,11 +20,11 @@ * - Modified by Marshal 2011-6-24 (added regex) * - Modified by Brian Reavis 2012-8-27 (cleanup) */ - + var highlight = function($element, pattern) { if (typeof pattern === 'string' && !pattern.length) return; var regex = (typeof pattern === 'string') ? new RegExp(pattern, 'i') : pattern; - + var highlight = function(node) { var skip = 0; if (node.nodeType === 3) { @@ -47,12 +47,12 @@ } return skip; }; - + return $element.each(function() { highlight(this); }); }; - + var unhighlight = function($element) { return $element.find('span.highlight').each(function() { var parent = this.parentNode; @@ -60,9 +60,9 @@ parent.normalize(); }).end(); }; - + /* --- file: "src/contrib/microevent.js" --- */ - + /** * MicroEvent - to make any js object an event emitter * @@ -72,7 +72,7 @@ * * @author Jerome Etienne (https://github.com/jeromeetienne) */ - + var MicroEvent = function() {}; MicroEvent.prototype = { on: function(event, fct){ @@ -93,7 +93,7 @@ } } }; - + /** * Mixin will delegate all MicroEvent.js function in the destination object. * @@ -107,9 +107,9 @@ destObject.prototype[props[i]] = MicroEvent.prototype[props[i]]; } }; - + /* --- file: "src/constants.js" --- */ - + /** * selectize - A highly customizable select control with autocomplete. * Copyright (c) 2013 Brian Reavis & contributors @@ -125,9 +125,9 @@ * * @author Brian Reavis */ - + var IS_MAC = /Mac/.test(navigator.userAgent); - + var KEY_A = 65; var KEY_COMMA = 188; var KEY_RETURN = 13; @@ -142,10 +142,10 @@ var KEY_CMD = IS_MAC ? 91 : 17; var KEY_CTRL = IS_MAC ? 18 : 17; var KEY_TAB = 9; - + var TAG_SELECT = 1; var TAG_INPUT = 2; - + var DIACRITICS = { 'a': '[aÀÁÂÃÄÅàáâãäå]', 'c': '[cÇç]', @@ -158,14 +158,14 @@ 'y': '[yŸÿý]', 'z': '[zŽž]' }; - + /* --- file: "src/plugins.js" --- */ - + var Plugins = {}; - + Plugins.mixin = function(Interface, interfaceName) { Interface.plugins = {}; - + /** * Initializes the provided functions. * Acceptable formats: @@ -182,7 +182,7 @@ var i, n, key; this.plugins = []; this.pluginSettings = {}; - + if ($.isArray(plugins)) { for (i = 0, n = plugins.length; i < n; i++) { this.loadPlugin(plugins[i]); @@ -196,7 +196,7 @@ } } }; - + /** * Initializes a plugin. * @@ -204,14 +204,14 @@ */ Interface.prototype.loadPlugin = function(name) { var plugin, i, n; - + if (this.plugins.indexOf(name) !== -1) return; if (!Interface.plugins.hasOwnProperty(name)) { throw new Error(interfaceName + ' unable to find "' + name + '" plugin'); } - + plugin = Interface.plugins[name]; - + // initialize plugin and dependencies this.plugins.push(name); for (i = 0, n = plugin.dependencies.length; i < n; i++) { @@ -219,7 +219,7 @@ } plugin.fn.apply(this, [this.pluginSettings[name] || {}]); }; - + /** * Registers a plugin. * @@ -236,23 +236,23 @@ }; }; }; - + /* --- file: "src/utils.js" --- */ - + var isset = function(object) { return typeof object !== 'undefined'; }; - + var htmlEntities = function(str) { return String(str).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); }; - + var quoteRegExp = function(str) { return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'); }; - + var hook = {}; - + /** * Wraps `method` on `self` so that `fn` * is invoked before the original method. @@ -268,7 +268,7 @@ return original.apply(self, arguments); }; }; - + /** * Wraps `method` on `self` so that `fn` * is invoked after the original method. @@ -285,7 +285,7 @@ return result; }; }; - + var once = function(fn) { var called = false; return function() { @@ -294,7 +294,7 @@ fn.apply(this, arguments); }; }; - + var debounce = function(fn, delay) { var timeout; return function() { @@ -306,7 +306,7 @@ }, delay); }; }; - + /** * Debounce all fired events types listed in `types` * while executing the provided `fn`. @@ -319,16 +319,16 @@ var type; var trigger = self.trigger; var event_args = {}; - + // override trigger method self.trigger = function() { event_args[arguments[0]] = arguments; }; - + // invoke provided function fn.apply(self, []); self.trigger = trigger; - + // trigger queued events for (type in event_args) { if (event_args.hasOwnProperty(type)) { @@ -336,7 +336,7 @@ } } }; - + /** * A workaround for http://bugs.jquery.com/ticket/6696 * @@ -355,7 +355,7 @@ return fn.apply(this, [e]); }); }; - + var getSelection = function(input) { var result = {}; if ('selectionStart' in input) { @@ -371,7 +371,7 @@ } return result; }; - + var transferStyles = function($from, $to, properties) { var styles = {}; if (properties) { @@ -384,7 +384,7 @@ $to.css(styles); return $to; }; - + var measureString = function(str, $parent) { var $test = $('').css({ position: 'absolute', @@ -394,7 +394,7 @@ padding: 0, whiteSpace: 'nowrap' }).text(str).appendTo('body'); - + transferStyles($parent, $test, [ 'letterSpacing', 'fontSize', @@ -402,22 +402,22 @@ 'fontWeight', 'textTransform' ]); - + var width = $test.width(); $test.remove(); - + return width; }; - + var autoGrow = function($input) { var update = function(e) { var value, keyCode, printable, placeholder, width; var shift, character, selection; e = e || window.event || {}; - + if (e.metaKey || e.altKey) return; if ($input.data('grow') === false) return; - + value = $input.val(); if (e.type && e.type.toLowerCase() === 'keydown') { keyCode = e.keyCode; @@ -427,7 +427,7 @@ (keyCode >= 48 && keyCode <= 57) || // 0-9 keyCode == 32 // space ); - + if (keyCode === KEY_DELETE || keyCode === KEY_BACKSPACE) { selection = getSelection($input[0]); if (selection.length) { @@ -445,25 +445,25 @@ value += character; } } - + placeholder = $input.attr('placeholder') || ''; if (!value.length && placeholder.length) { value = placeholder; } - + width = measureString(value, $input) + 4; if (width !== $input.width()) { $input.width(width); $input.triggerHandler('resize'); } }; - + $input.on('keydown keyup update blur', update); update(); }; - + /* --- file: "src/selectize.js" --- */ - + /** * selectize.js * Copyright (c) 2013 Brian Reavis & contributors @@ -479,15 +479,15 @@ * * @author Brian Reavis */ - + var Selectize = function($input, settings) { var key, i, n; $input[0].selectize = this; - + this.$input = $input; this.tagType = $input[0].tagName.toLowerCase() === 'select' ? TAG_SELECT : TAG_INPUT; this.settings = settings; - + this.highlightedValue = null; this.isOpen = false; this.isDisabled = false; @@ -507,17 +507,17 @@ this.caretPos = 0; this.loading = 0; this.loadedSearches = {}; - + this.$activeOption = null; this.$activeItems = []; - + this.optgroups = {}; this.options = {}; this.userOptions = {}; this.items = []; this.renderCache = {}; this.onSearchChange = debounce(this.onSearchChange, this.settings.loadThrottle); - + if ($.isArray(settings.options)) { key = settings.valueField; for (i = 0, n = settings.options.length; i < n; i++) { @@ -529,7 +529,7 @@ $.extend(this.options, settings.options); delete this.settings.options; } - + if ($.isArray(settings.optgroups)) { key = settings.optgroupValueField; for (i = 0, n = settings.optgroups.length; i < n; i++) { @@ -541,27 +541,27 @@ $.extend(this.optgroups, settings.optgroups); delete this.settings.optgroups; } - + // option-dependent defaults this.settings.mode = this.settings.mode || (this.settings.maxItems === 1 ? 'single' : 'multi'); if (typeof this.settings.hideSelected !== 'boolean') { this.settings.hideSelected = this.settings.mode === 'multi'; } - + this.loadPlugins(this.settings.plugins); this.setupCallbacks(); this.setup(); }; - + // mixins // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + MicroEvent.mixin(Selectize); Plugins.mixin(Selectize, 'Selectize'); - + // methods // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + /** * Creates all elements and sets up event bindings. */ @@ -572,47 +572,49 @@ var $control_input; var $dropdown; var $dropdown_content; + var $dropdown_parent; var inputMode; var timeout_blur; var timeout_focus; var tab_index; var classes; - + tab_index = this.$input.attr('tabindex') || ''; classes = this.$input.attr('class') || ''; $wrapper = $('
').addClass(this.settings.theme).addClass(this.settings.wrapperClass).addClass(classes); $control = $('
').addClass(this.settings.inputClass).addClass('items').toggleClass('has-options', !$.isEmptyObject(this.options)).appendTo($wrapper); $control_input = $('').appendTo($control).attr('tabindex',tab_index); - $dropdown = $('
').addClass(this.settings.dropdownClass).hide().appendTo($wrapper); + $dropdown_parent = $(this.settings.dropdownParent || $wrapper); + $dropdown = $('
').addClass(this.settings.dropdownClass).hide().appendTo($dropdown_parent); $dropdown_content = $('
').addClass(this.settings.dropdownContentClass).appendTo($dropdown); - + $wrapper.css({ width: this.$input[0].style.width, display: this.$input.css('display') }); - + if (this.plugins.length) { $wrapper.addClass('plugin-' + this.plugins.join(' plugin-')); } - + inputMode = this.settings.mode; $wrapper.toggleClass('single', inputMode === 'single'); $wrapper.toggleClass('multi', inputMode === 'multi'); - + if ((this.settings.maxItems === null || this.settings.maxItems > 1) && this.tagType === TAG_SELECT) { this.$input.attr('multiple', 'multiple'); } - + if (this.settings.placeholder) { $control_input.attr('placeholder', this.settings.placeholder); } - + this.$wrapper = $wrapper; this.$control = $control; this.$control_input = $control_input; this.$dropdown = $dropdown; this.$dropdown_content = $dropdown_content; - + $control.on('mousedown', function(e) { if (!e.isDefaultPrevented()) { window.setTimeout(function() { @@ -620,12 +622,20 @@ }, 0); } }); - + + // necessary for mobile webkit devices (manual focus triggering + // is ignored unless invoked within a click event) + $control.on('click', function(e) { + if (!self.isInputFocused) { + self.focus(true); + } + }); + $dropdown.on('mouseenter', '[data-selectable]', function() { return self.onOptionHover.apply(self, arguments); }); $dropdown.on('mousedown', '[data-selectable]', function() { return self.onOptionSelect.apply(self, arguments); }); watchChildEvent($control, 'mousedown', '*:not(input)', function() { return self.onItemSelect.apply(self, arguments); }); autoGrow($control_input); - + $control_input.on({ mousedown : function(e) { e.stopPropagation(); }, keydown : function() { return self.onKeyDown.apply(self, arguments); }, @@ -635,7 +645,7 @@ blur : function() { return self.onBlur.apply(self, arguments); }, focus : function() { return self.onFocus.apply(self, arguments); } }); - + $(document).on({ keydown: function(e) { self.isCmdDown = e[IS_MAC ? 'metaKey' : 'ctrlKey']; @@ -666,7 +676,7 @@ } } }); - + $(window).on({ resize: function() { if (self.isOpen) { @@ -677,29 +687,29 @@ self.ignoreHover = false; } }); - + this.$input.attr('tabindex',-1).hide().after(this.$wrapper); - + if ($.isArray(this.settings.items)) { this.setValue(this.settings.items); delete this.settings.items; } - + this.updateOriginalInput(); this.refreshItems(); this.updatePlaceholder(); this.isSetup = true; - + if (this.$input.is(':disabled')) { this.disable(); } - + // preload options if (this.settings.preload) { this.onSearchChange(''); } }; - + /** * Maps fired events to callbacks provided * in the settings used when creating the control. @@ -717,7 +727,7 @@ 'dropdown_close' : 'onDropdownClose', 'type' : 'onType' }; - + for (key in callbacks) { if (callbacks.hasOwnProperty(key)) { fn = this.settings[callbacks[key]]; @@ -725,7 +735,7 @@ } } }; - + /** * Triggers a callback defined in the user-provided settings. * Events: onItemAdd, onOptionAdd, etc @@ -739,7 +749,7 @@ this.settings[event].apply(this, args); } }; - + /** * Triggered on keypress. * @@ -755,7 +765,7 @@ return false; } }; - + /** * Triggered on keydown. * @@ -764,14 +774,14 @@ */ Selectize.prototype.onKeyDown = function(e) { var isInput = e.target === this.$control_input[0]; - + if (this.isLocked) { if (e.keyCode !== KEY_TAB) { e.preventDefault(); } return; } - + switch (e.keyCode) { case KEY_A: if (this.isCmdDown) { @@ -829,7 +839,7 @@ return; } }; - + /** * Triggered on keyup. * @@ -846,7 +856,7 @@ this.trigger('type', value); } }; - + /** * Invokes the user-provide option provider / loader. * @@ -865,7 +875,7 @@ fn.apply(self, [value, callback]); }); }; - + /** * Triggered on focus. * @@ -880,14 +890,16 @@ e.preventDefault(); return false; } + if (this.ignoreFocus) return; - + if (this.settings.preload === 'focus') this.onSearchChange(''); + this.showInput(); this.setActiveItem(null); this.refreshOptions(!!this.settings.openOnFocus); this.refreshClasses(); }; - + /** * Triggered on blur. * @@ -897,7 +909,7 @@ Selectize.prototype.onBlur = function(e) { this.isInputFocused = false; if (this.ignoreFocus) return; - + this.close(); this.setTextboxValue(''); this.setActiveItem(null); @@ -906,7 +918,7 @@ this.isFocused = false; this.refreshClasses(); }; - + /** * Triggered when the user rolls over * an option in the autocomplete dropdown menu. @@ -918,7 +930,7 @@ if (this.ignoreHover) return; this.setActiveOption(e.currentTarget, false); }; - + /** * Triggered when the user clicks on an option * in the autocomplete dropdown menu. @@ -930,7 +942,7 @@ e.preventDefault && e.preventDefault(); e.stopPropagation && e.stopPropagation(); this.focus(false); - + var $target = $(e.currentTarget); if ($target.hasClass('create')) { this.createItem(); @@ -942,7 +954,7 @@ } } }; - + /** * Triggered when the user clicks on an item * that has been selected. @@ -958,7 +970,7 @@ this.hideInput(); } }; - + /** * Invokes the provided method that provides * results to a callback---which are then added @@ -969,7 +981,7 @@ Selectize.prototype.load = function(fn) { var self = this; var $wrapper = self.$wrapper.addClass('loading'); - + self.loading++; fn.apply(self, [function(results) { self.loading = Math.max(self.loading - 1, 0); @@ -984,7 +996,7 @@ self.trigger('load', results); }]); }; - + /** * Sets the input field of the control to the specified value. * @@ -994,7 +1006,7 @@ this.$control_input.val(value).triggerHandler('update'); this.lastValue = value; }; - + /** * Returns the value of the control. If multiple items * can be selected (e.g. or * element to reflect the current state. */ Selectize.prototype.updateOriginalInput = function() { var i, n, options; - + if (this.$input[0].tagName.toLowerCase() === 'select') { options = []; for (i = 0, n = this.items.length; i < n; i++) { @@ -1858,13 +1870,13 @@ } else { this.$input.val(this.getValue()); } - + this.$input.trigger('change'); if (this.isSetup) { this.trigger('change', this.$input.val()); } }; - + /** * Shows/hide the input placeholder depending * on if there items in the list already. @@ -1872,7 +1884,7 @@ Selectize.prototype.updatePlaceholder = function() { if (!this.settings.placeholder) return; var $input = this.$control_input; - + if (this.items.length) { $input.removeAttr('placeholder'); } else { @@ -1880,7 +1892,7 @@ } $input.triggerHandler('update'); }; - + /** * Shows the autocomplete dropdown containing * the available options. @@ -1895,7 +1907,7 @@ this.$dropdown.css({visibility: 'visible'}); this.trigger('dropdown_open', this.$dropdown); }; - + /** * Closes the autocomplete dropdown menu. */ @@ -1907,23 +1919,23 @@ this.isOpen = false; this.trigger('dropdown_close', this.$dropdown); }; - + /** * Calculates and applies the appropriate * position of the dropdown. */ Selectize.prototype.positionDropdown = function() { var $control = this.$control; - var offset = $control.position(); + var offset = this.settings.dropdownParent === 'body' ? $control.offset() : $control.position(); offset.top += $control.outerHeight(true); - + this.$dropdown.css({ width : $control.outerWidth(), top : offset.top, left : offset.left }); }; - + /** * Resets / clears all selected items * from the control. @@ -1939,7 +1951,7 @@ this.showInput(); this.trigger('clear'); }; - + /** * A helper method for inserting an element * at the current caret position. @@ -1955,7 +1967,7 @@ } this.setCaret(caret + 1); }; - + /** * Removes the current selected item(s). * @@ -1964,18 +1976,18 @@ */ Selectize.prototype.deleteSelection = function(e) { var i, n, direction, selection, values, caret, $tail; - + direction = (e && e.keyCode === KEY_BACKSPACE) ? -1 : 1; selection = getSelection(this.$control_input[0]); - + // determine items that will be removed values = []; - + if (this.$activeItems.length) { $tail = this.$control.children('.active:' + (direction > 0 ? 'last' : 'first')); caret = this.$control.children(':not(input)').index($tail); if (direction > 0) { caret++; } - + for (i = 0, n = this.$activeItems.length; i < n; i++) { values.push($(this.$activeItems[i]).attr('data-value')); } @@ -1990,12 +2002,12 @@ values.push(this.items[this.caretPos]); } } - + // allow the callback to abort if (!values.length || (typeof this.settings.onDelete === 'function' && this.settings.onDelete(values) === false)) { return false; } - + // perform removal if (typeof caret !== 'undefined') { this.setCaret(caret); @@ -2003,12 +2015,12 @@ while (values.length) { this.removeItem(values.pop()); } - + this.showInput(); this.refreshOptions(true); return true; }; - + /** * Selects the previous / next item (depending * on the `direction` argument). @@ -2021,18 +2033,18 @@ */ Selectize.prototype.advanceSelection = function(direction, e) { var tail, selection, idx, valueLength, cursorAtEdge, $tail; - + if (direction === 0) return; - + tail = direction > 0 ? 'last' : 'first'; selection = getSelection(this.$control_input[0]); - + if (this.isInputFocused && !this.isInputHidden) { valueLength = this.$control_input.val().length; cursorAtEdge = direction < 0 ? selection.start === 0 && selection.length === 0 : selection.start === valueLength; - + if (cursorAtEdge && !valueLength) { this.advanceCaret(direction, e); } @@ -2046,7 +2058,7 @@ } } }; - + /** * Moves the caret left / right. * @@ -2067,7 +2079,7 @@ this.setCaret(this.caretPos + direction); } }; - + /** * Moves the caret to the specified index. * @@ -2079,7 +2091,7 @@ } else { i = Math.max(0, Math.min(this.items.length, i)); } - + // the input must be moved by leaving it in place and moving the // siblings, due to the fact that focus cannot be restored once lost // on mobile webkit devices @@ -2093,10 +2105,10 @@ this.$control.append($child); } } - + this.caretPos = i; }; - + /** * Disables user input on the control. Used while * items are being asynchronously created. @@ -2106,7 +2118,7 @@ this.isLocked = true; this.refreshClasses(); }; - + /** * Re-enables user input on the control. */ @@ -2114,7 +2126,7 @@ this.isLocked = false; this.refreshClasses(); }; - + /** * Disables user input on the control completely. * While disabled, it cannot receive focus. @@ -2123,7 +2135,7 @@ this.isDisabled = true; this.lock(); }; - + /** * Enables the control so that it can respond * to focus and user input. @@ -2132,7 +2144,7 @@ this.isDisabled = false; this.unlock(); }; - + /** * A helper method for rendering "item" and * "option" templates, given the data. @@ -2146,12 +2158,12 @@ var html = ''; var cache = false; var regex_tag = /^[\ ]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i; - + if (templateName === 'option' || templateName === 'item') { value = data[this.settings.valueField]; cache = isset(value); } - + // pull markup from cache if it exists if (cache) { if (!isset(this.renderCache[templateName])) { @@ -2161,7 +2173,7 @@ return this.renderCache[templateName][value]; } } - + // render markup if (this.settings.render && typeof this.settings.render[templateName] === 'function') { html = this.settings.render[templateName].apply(this, [data, htmlEntities]); @@ -2186,7 +2198,7 @@ break; } } - + // add mandatory attributes if (templateName === 'option' || templateName === 'option_create') { html = html.replace(regex_tag, '<$1 data-selectable'); @@ -2198,15 +2210,15 @@ if (templateName === 'option' || templateName === 'item') { html = html.replace(regex_tag, '<$1 data-value="' + htmlEntities(value || '') + '"'); } - + // update cache if (cache) { this.renderCache[templateName][value] = html; } - + return html; }; - + Selectize.defaults = { plugins: [], delimiter: ',', @@ -2219,10 +2231,10 @@ maxItems: null, hideSelected: null, preload: false, - + scrollDuration: 60, loadThrottle: 300, - + dataAttr: 'data-data', optgroupField: 'optgroup', sortField: null, @@ -2233,14 +2245,16 @@ optgroupValueField: 'value', optgroupOrder: null, searchField: ['text'], - + mode: null, theme: 'default', wrapperClass: 'selectize-control', inputClass: 'selectize-input', dropdownClass: 'selectize-dropdown', dropdownContentClass: 'selectize-dropdown-content', - + + dropdownParent: null, + load : null, // function(query, callback) score : null, // function(search) onChange : null, // function(value) @@ -2254,7 +2268,7 @@ onDropdownClose : null, // function($dropdown) { ... } onType : null, // function(str) { ... } onDelete : null, // function(values) { ... } - + render: { item: null, optgroup: null, @@ -2263,15 +2277,15 @@ option_create: null } }; - + /* --- file: "src/selectize.jquery.js" --- */ - + $.fn.selectize = function(settings) { settings = settings || {}; - + var defaults = $.fn.selectize.defaults; var dataAttr = settings.dataAttr || defaults.dataAttr; - + /** * Initializes selectize from a element. * @@ -2281,7 +2295,7 @@ var init_textbox = function($input, settings_element) { var i, n, values, value = $.trim($input.val() || ''); if (!value.length) return; - + values = value.split(settings.delimiter || defaults.delimiter); for (i = 0, n = values.length; i < n; i++) { settings_element.options[values[i]] = { @@ -2289,10 +2303,10 @@ 'value' : values[i] }; } - + settings_element.items = values; }; - + /** * Initializes selectize from a