dist/toolkit.js
function(select, options) {
        this.element = select = $(select);
        options = this.setOptions(options, select);
        this.multiple = select.prop('multiple');

        // Multiple selects must use native controls
        if (this.multiple && options.native) {
            return;
        }

        // Wrapping element
        this.wrapper = this._buildWrapper();

        // Button element to open the drop menu
        this.input = this._buildButton();

        // Initialize events
        this.addEvent('change', 'element', 'onChange');

        if (!options.native) {
            this.addEvents([
                ['blur', 'element', 'hide'],
                ['clickout', 'dropdown', 'hide'],
                ['click', 'input', 'onToggle']
            ]);

            if (!this.multiple) {
                this.addEvent('keydown', 'window', 'onCycle');
            }

            // Build custom dropdown when not in native
            this.dropdown = this._buildDropdown();

            // Cant hide/invisible the real select or we lose focus/blur
            // So place it below .custom-input
            this.element.css('z-index', 1);
        }

        this.initialize();

        // Trigger change immediately to update the label
        this.element.change();
    }
function(select, options) {
        this.element = select = $(select);
        options = this.setOptions(options, select);
        this.multiple = select.prop('multiple');

        // Multiple selects must use native controls
        if (this.multiple && options.native) {
            return;
        }

        // Wrapping element
        this.wrapper = this._buildWrapper();

        // Button element to open the drop menu
        this.input = this._buildButton();

        // Initialize events
        this.addEvent('change', 'element', 'onChange');

        if (!options.native) {
            this.addEvents([
                ['blur', 'element', 'hide'],
                ['clickout', 'dropdown', 'hide'],
                ['click', 'input', 'onToggle']
            ]);

            if (!this.multiple) {
                this.addEvent('keydown', 'window', 'onCycle');
            }

            // Build custom dropdown when not in native
            this.dropdown = this._buildDropdown();

            // Cant hide/invisible the real select or we lose focus/blur
            // So place it below .custom-input
            this.element.css('z-index', 1);
        }

        this.initialize();

        // Trigger change immediately to update the label
        this.element.change();
    }
function ( select , options ) { this . element = select = $ ( select ) ; options = this . setOptions ( options , select ) ; this . multiple = select . prop ( 'multiple' ) ; // Multiple selects must use native controls if ( this . multiple && options . native ) { return ; } // Wrapping element this . wrapper = this . _buildWrapper ( ) ; // Button element to open the drop menu this . input = this . _buildButton ( ) ; // Initialize events this . addEvent ( 'change' , 'element' , 'onChange' ) ; if ( ! options . native ) { this . addEvents ( [ [ 'blur' , 'element' , 'hide' ] , [ 'clickout' , 'dropdown' , 'hide' ] , [ 'click' , 'input' , 'onToggle' ] ] ) ; if ( ! this . multiple ) { this . addEvent ( 'keydown' , 'window' , 'onCycle' ) ; } // Build custom dropdown when not in native this . dropdown = this . _buildDropdown ( ) ; // Cant hide/invisible the real select or we lose focus/blur // So place it below .custom-input this . element . css ( 'z-index' , 1 ) ; } this . initialize ( ) ; // Trigger change immediately to update the label this . element . change ( ) ; }
Initialize the select.

@param {jQuery} select
@param {Object} [options]
Initialize the select .