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BE,GAC5C,QAAqBtS,IAAjBuS,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,CAAC,GAOX,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,OACf,CCrBAH,EAAoBM,EAAKF,IACxB,IAAIG,EAASH,GAAUA,EAAOI,WAC7B,IAAOJ,EAAiB,QACxB,IAAM,EAEP,OADAJ,EAAoBS,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdP,EAAoBS,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAI9H,KAAO8H,EACXX,EAAoBY,EAAED,EAAY9H,KAASmH,EAAoBY,EAAET,EAAStH,IAC5EgI,OAAOC,eAAeX,EAAStH,EAAK,CAAEkI,YAAY,EAAMhE,IAAK4D,EAAW9H,IAE1E,ECNDmH,EAAoBY,EAAI,CAACjH,EAAKxH,IAAU0O,OAAOvR,UAAU0R,eAAe/K,KAAK0D,EAAKxH,G,0BCClFzE,SAASuT,iBAAiB,oBAAoB,WAC5C,MAAMzT,EAAIsS,OACkBtS,EAAE,UAAUD,cACpByK,GAAG,UAAU,SAASO,GACxCA,EAAEiB,kBACFhM,EAAEc,MAAM4S,QAAQ,QAAQvR,KAAK,yBAAyBwR,QACtD7S,KAAK8S,cAAc,IAAIC,MAAM,sBAC/B,GACF,G","sources":["webpack://customtheme/./js/vendor/selectboxit.js","webpack://customtheme/webpack/bootstrap","webpack://customtheme/webpack/runtime/compat get default export","webpack://customtheme/webpack/runtime/define property getters","webpack://customtheme/webpack/runtime/hasOwnProperty shorthand","webpack://customtheme/./js/custom-filters.js"],"sourcesContent":["/*! jquery.selectBoxIt - v3.8.1 - 2013-10-17\n* http://www.selectboxit.com\n* Copyright (c) 2013 Greg Franko; Licensed MIT*/\n\n// Immediately-Invoked Function Expression (IIFE) [Ben Alman Blog Post](http://benalman.com/news/2010/11/immediately-invoked-function-expression/) that calls another IIFE that contains all of the plugin logic. I used this pattern so that anyone viewing this code would not have to scroll to the bottom of the page to view the local parameters that were passed to the main IIFE.\n\n;(function (selectBoxIt) {\n\n //ECMAScript 5 Strict Mode: [John Resig Blog Post](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/)\n \"use strict\";\n\n // Calls the second IIFE and locally passes in the global jQuery, window, and document objects\n selectBoxIt(window.jQuery, window, document);\n\n}\n\n// Locally passes in `jQuery`, the `window` object, the `document` object, and an `undefined` variable. The `jQuery`, `window` and `document` objects are passed in locally, to improve performance, since javascript first searches for a variable match within the local variables set before searching the global variables set. All of the global variables are also passed in locally to be minifier friendly. `undefined` can be passed in locally, because it is not a reserved word in JavaScript.\n\n(function ($, window, document, undefined) {\n\n // ECMAScript 5 Strict Mode: [John Resig Blog Post](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/)\n \"use strict\";\n\n // Calling the jQueryUI Widget Factory Method\n $.widget(\"selectBox.selectBoxIt\", {\n\n // Plugin version\n VERSION: \"3.8.2\",\n\n // These options will be used as defaults\n options: {\n\n // **showEffect**: Accepts String: \"none\", \"fadeIn\", \"show\", \"slideDown\", or any of the jQueryUI show effects (i.e. \"bounce\")\n \"showEffect\": \"none\",\n\n // **showEffectOptions**: Accepts an object literal. All of the available properties are based on the jqueryUI effect options\n \"showEffectOptions\": {},\n\n // **showEffectSpeed**: Accepts Number (milliseconds) or String: \"slow\", \"medium\", or \"fast\"\n \"showEffectSpeed\": \"medium\",\n\n // **hideEffect**: Accepts String: \"none\", \"fadeOut\", \"hide\", \"slideUp\", or any of the jQueryUI hide effects (i.e. \"explode\")\n \"hideEffect\": \"none\",\n\n // **hideEffectOptions**: Accepts an object literal. All of the available properties are based on the jqueryUI effect options\n \"hideEffectOptions\": {},\n\n // **hideEffectSpeed**: Accepts Number (milliseconds) or String: \"slow\", \"medium\", or \"fast\"\n \"hideEffectSpeed\": \"medium\",\n\n // **showFirstOption**: Shows the first dropdown list option within the dropdown list options list\n \"showFirstOption\": true,\n\n // **defaultText**: Overrides the text used by the dropdown list selected option to allow a user to specify custom text. Accepts a String.\n \"defaultText\": \"\",\n\n // **defaultIcon**: Overrides the icon used by the dropdown list selected option to allow a user to specify a custom icon. Accepts a String (CSS class name(s)).\n \"defaultIcon\": \"\",\n\n // **downArrowIcon**: Overrides the default down arrow used by the dropdown list to allow a user to specify a custom image. Accepts a String (CSS class name(s)).\n \"downArrowIcon\": \"\",\n\n // **theme**: Provides theming support for Twitter Bootstrap and jQueryUI\n \"theme\": \"default\",\n\n // **keydownOpen**: Opens the dropdown if the up or down key is pressed when the dropdown is focused\n \"keydownOpen\": true,\n\n // **isMobile**: Function to determine if a user's browser is a mobile browser\n \"isMobile\": function() {\n\n // Adapted from http://www.detectmobilebrowsers.com\n var ua = navigator.userAgent || navigator.vendor || window.opera;\n\n // Checks for iOs, Android, Blackberry, Opera Mini, and Windows mobile devices\n return (/iPhone|iPod|iPad|Silk|Android|BlackBerry|Opera Mini|IEMobile/).test(ua);\n\n },\n\n // **native**: Triggers the native select box when a user interacts with the drop down\n \"native\": false,\n\n // **aggressiveChange**: Will select a drop down item (and trigger a change event) when a user navigates to the item via the keyboard (up and down arrow or search), before a user selects an option with a click or the enter key\n \"aggressiveChange\": false,\n\n // **selectWhenHidden: Will allow a user to select an option using the keyboard when the drop down list is hidden and focused\n \"selectWhenHidden\": true,\n\n // **viewport**: Allows for a custom domnode used for the viewport. Accepts a selector. Default is $(window).\n \"viewport\": $(window),\n\n // **similarSearch**: Optimizes the search for lists with many similar values (i.e. State lists) by making it easier to navigate through\n \"similarSearch\": false,\n\n // **copyAttributes**: HTML attributes that will be copied over to the new drop down\n \"copyAttributes\": [\n\n \"title\",\n\n \"rel\"\n\n ],\n \n // **dontCopyAttributes: HTML attributes to explicitly blacklist from being copied to the new dropdown\n \"dontCopyAttributes\": [\n\n \"data-reactid\"\n\n ],\n\n // **copyClasses**: HTML classes that will be copied over to the new drop down. The value indicates where the classes should be copied. The default value is 'button', but you can also use 'container' (recommended) or 'none'.\n \"copyClasses\": \"button\",\n\n // **nativeMousedown**: Mimics native firefox drop down behavior by opening the drop down on mousedown and selecting the currently hovered drop down option on mouseup\n \"nativeMousedown\": false,\n\n // **customShowHideEvent**: Prevents the drop down from opening on click or mousedown, which allows a user to open/close the drop down with a custom event handler.\n \"customShowHideEvent\": false,\n\n // **autoWidth**: Makes sure the width of the drop down is wide enough to fit all of the drop down options\n \"autoWidth\": true,\n\n // **html**: Determines whether or not option text is rendered as html or as text\n \"html\": true,\n\n // **populate**: Convenience option that accepts JSON data, an array, a single object, or valid HTML string to add options to the drop down list\n \"populate\": \"\",\n\n // **dynamicPositioning**: Determines whether or not the drop down list should fit inside it's viewport\n \"dynamicPositioning\": true,\n\n // **hideCurrent**: Determines whether or not the currently selected drop down option is hidden in the list\n \"hideCurrent\": false,\n\n // **numSearchCharacters**: Option for how many characters a user must search to be treated as a full string search\n \"numSearchCharacters\": \"auto\"\n\n },\n\n // Get Themes\n // ----------\n // Retrieves the active drop down theme and returns the theme object\n \"getThemes\": function() {\n\n var self = this,\n theme = $(self.element).attr(\"data-theme\") || \"c\";\n\n return {\n\n // Twitter Bootstrap Theme\n \"bootstrap\": {\n\n \"focus\": \"active\",\n\n \"hover\": \"\",\n\n \"enabled\": \"enabled\",\n\n \"disabled\": \"disabled\",\n\n \"arrow\": \"caret\",\n\n \"button\": \"btn\",\n\n \"list\": \"dropdown-menu\",\n\n \"container\": \"bootstrap\",\n\n \"open\": \"open\"\n\n },\n\n // jQueryUI Theme\n \"jqueryui\": {\n\n \"focus\": \"ui-state-focus\",\n\n \"hover\": \"ui-state-hover\",\n\n \"enabled\": \"ui-state-enabled\",\n\n \"disabled\": \"ui-state-disabled\",\n\n \"arrow\": \"ui-icon ui-icon-triangle-1-s\",\n\n \"button\": \"ui-widget ui-state-default\",\n\n \"list\": \"ui-widget ui-widget-content\",\n\n \"container\": \"jqueryui\",\n\n \"open\": \"selectboxit-open\"\n\n },\n\n // jQuery Mobile Theme\n \"jquerymobile\": {\n\n \"focus\": \"ui-btn-down-\" + theme,\n\n \"hover\": \"ui-btn-hover-\" + theme,\n\n \"enabled\": \"ui-enabled\",\n\n \"disabled\": \"ui-disabled\",\n\n \"arrow\": \"ui-icon ui-icon-arrow-d ui-icon-shadow\",\n\n \"button\": \"ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-\" + theme,\n\n \"list\": \"ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-\" + theme,\n\n \"container\": \"jquerymobile\",\n\n \"open\": \"selectboxit-open\"\n\n },\n\n \"default\": {\n\n \"focus\": \"selectboxit-focus\",\n\n \"hover\": \"selectboxit-hover\",\n\n \"enabled\": \"selectboxit-enabled\",\n\n \"disabled\": \"selectboxit-disabled\",\n\n \"arrow\": \"selectboxit-default-arrow\",\n\n \"button\": \"selectboxit-btn\",\n\n \"list\": \"selectboxit-list\",\n\n \"container\": \"selectboxit-container\",\n\n \"open\": \"selectboxit-open\"\n\n }\n\n };\n\n },\n\n // isDeferred\n // ----------\n // Checks if parameter is a defered object \n isDeferred: function(def) {\n return $.isPlainObject(def) && def.promise && def.done;\n },\n\n // _Create\n // -------\n // Sets the Plugin Instance variables and\n // constructs the plugin. Only called once.\n _create: function(internal) {\n\n var self = this,\n populateOption = self.options[\"populate\"],\n userTheme = self.options[\"theme\"];\n\n // If the element calling SelectBoxIt is not a select box or is not visible\n if(!self.element.is(\"select\")) {\n\n // Exits the plugin\n return;\n\n }\n\n // Stores a reference to the parent Widget class\n self.widgetProto = $.Widget.prototype;\n\n // The original select box DOM element\n self.originalElem = self.element[0];\n\n // The original select box DOM element wrapped in a jQuery object\n self.selectBox = self.element;\n\n if(self.options[\"populate\"] && self.add && !internal) {\n\n self.add(populateOption);\n\n }\n\n // All of the original select box options\n self.selectItems = self.element.find(\"option\");\n\n // The first option in the original select box\n self.firstSelectItem = self.selectItems.slice(0, 1);\n\n // The html document height\n self.documentHeight = $(document).height();\n\n self.theme = $.isPlainObject(userTheme) ? $.extend({}, self.getThemes()[\"default\"], userTheme) : self.getThemes()[userTheme] ? self.getThemes()[userTheme] : self.getThemes()[\"default\"];\n\n // The index of the currently selected dropdown list option\n self.currentFocus = 0;\n\n // Keeps track of which blur events will hide the dropdown list options\n self.blur = true;\n\n // Array holding all of the original select box options text\n self.textArray = [];\n\n // Maintains search order in the `search` method\n self.currentIndex = 0;\n\n // Maintains the current search text in the `search` method\n self.currentText = \"\";\n\n // Whether or not the dropdown list opens up or down (depending on how much room is on the page)\n self.flipped = false;\n\n // If the create method is not called internally by the plugin\n if(!internal) {\n\n // Saves the original select box `style` attribute within the `selectBoxStyles` plugin instance property\n self.selectBoxStyles = self.selectBox.attr(\"style\");\n\n }\n\n // Creates the dropdown elements that will become the dropdown\n // Creates the ul element that will become the dropdown options list\n // Add's all attributes (excluding id, class names, and unselectable properties) to the drop down and drop down items list\n // Hides the original select box and adds the new plugin DOM elements to the page\n // Adds event handlers to the new dropdown list\n self._createDropdownButton()._createUnorderedList()._copyAttributes()._replaceSelectBox()._addClasses(self.theme)._eventHandlers();\n\n if(self.originalElem.disabled && self.disable) {\n\n // Disables the dropdown list if the original dropdown list had the `disabled` attribute\n self.disable();\n\n }\n\n // If the Aria Accessibility Module has been included\n if(self._ariaAccessibility) {\n\n // Adds ARIA accessibillity tags to the dropdown list\n self._ariaAccessibility();\n\n }\n\n self.isMobile = self.options[\"isMobile\"]();\n\n if(self._mobile) {\n\n // Adds mobile support\n self._mobile();\n\n }\n\n // If the native option is set to true\n if(self.options[\"native\"]) {\n\n // Triggers the native select box when a user is interacting with the drop down\n this._applyNativeSelect();\n\n }\n\n // Triggers a custom `create` event on the original dropdown list\n self.triggerEvent(\"create\");\n\n // Maintains chainability\n return self;\n\n },\n\n // _Create dropdown button\n // -----------------------\n // Creates new dropdown and dropdown elements to replace\n // the original select box with a dropdown list\n _createDropdownButton: function() {\n\n var self = this,\n originalElemId = self.originalElemId = self.originalElem.id || \"\",\n originalElemValue = self.originalElemValue = self.originalElem.value || \"\",\n originalElemName = self.originalElemName = self.originalElem.name || \"\",\n copyClasses = self.options[\"copyClasses\"],\n selectboxClasses = self.selectBox.attr(\"class\") || \"\";\n\n // Creates a dropdown element that contains the dropdown list text value\n self.dropdownText = $(\"\", {\n\n // Dynamically sets the dropdown `id` attribute\n \"id\": originalElemId && originalElemId + \"SelectBoxItText\",\n\n \"class\": \"selectboxit-text\",\n\n // IE specific attribute to not allow the element to be selected\n \"unselectable\": \"on\",\n\n // Sets the dropdown `text` to equal the original select box default value\n \"text\": self.firstSelectItem.text()\n\n }).\n\n // Sets the HTML5 data attribute on the dropdownText `dropdown` element\n attr(\"data-val\", originalElemValue);\n\n self.dropdownImageContainer = $(\"\", {\n\n \"class\": \"selectboxit-option-icon-container\"\n\n });\n\n // Creates a dropdown element that contains the dropdown list text value\n self.dropdownImage = $(\"\", {\n\n // Dynamically sets the dropdown `id` attribute\n \"id\": originalElemId && originalElemId + \"SelectBoxItDefaultIcon\",\n\n \"class\": \"selectboxit-default-icon\",\n\n // IE specific attribute to not allow the element to be selected\n \"unselectable\": \"on\"\n\n });\n\n // Creates a dropdown to act as the new dropdown list\n self.dropdown = $(\"\", {\n\n // Dynamically sets the dropdown `id` attribute\n \"id\": originalElemId && originalElemId + \"SelectBoxIt\",\n\n \"class\": \"selectboxit \" + (copyClasses === \"button\" ? selectboxClasses: \"\") + \" \" + (self.selectBox.prop(\"disabled\") ? self.theme[\"disabled\"]: self.theme[\"enabled\"]),\n\n // Sets the dropdown `name` attribute to be the same name as the original select box\n \"name\": originalElemName,\n\n // Sets the dropdown `tabindex` attribute to 0 to allow the dropdown to be focusable\n \"tabindex\": self.selectBox.attr(\"tabindex\") || \"0\",\n\n // IE specific attribute to not allow the element to be selected\n \"unselectable\": \"on\"\n\n }).\n\n // Appends the default text to the inner dropdown list dropdown element\n append(self.dropdownImageContainer.append(self.dropdownImage)).append(self.dropdownText);\n\n // Create the dropdown container that will hold all of the dropdown list dom elements\n self.dropdownContainer = $(\"\", {\n\n \"id\": originalElemId && originalElemId + \"SelectBoxItContainer\",\n\n \"class\": 'selectboxit-container ' + self.theme.container + ' ' + (copyClasses === \"container\" ? selectboxClasses: \"\")\n\n }).\n\n // Appends the inner dropdown list dropdown element to the dropdown list container dropdown element\n append(self.dropdown);\n\n // Maintains chainability\n return self;\n\n },\n\n // _Create Unordered List\n // ----------------------\n // Creates an unordered list element to hold the\n // new dropdown list options that directly match\n // the values of the original select box options\n _createUnorderedList: function() {\n\n // Storing the context of the widget\n var self = this,\n\n dataDisabled,\n\n optgroupClass,\n\n optgroupElement,\n\n iconClass,\n\n iconUrl,\n\n iconUrlClass,\n\n iconUrlStyle,\n\n // Declaring the variable that will hold all of the dropdown list option elements\n currentItem = \"\",\n\n originalElemId = self.originalElemId || \"\",\n\n // Creates an unordered list element\n createdList = $(\"
    \", {\n\n // Sets the unordered list `id` attribute\n \"id\": originalElemId && originalElemId + \"SelectBoxItOptions\",\n\n \"class\": \"selectboxit-options\",\n\n //Sets the unordered list `tabindex` attribute to -1 to prevent the unordered list from being focusable\n \"tabindex\": -1\n\n }),\n\n currentDataSelectedText,\n\n currentDataText,\n\n currentDataSearch,\n\n currentText,\n\n currentOption,\n\n parent;\n\n // Checks the `showFirstOption` plugin option to determine if the first dropdown list option should be shown in the options list.\n if (!self.options[\"showFirstOption\"]) {\n\n // Disables the first select box option\n self.selectItems.first().attr(\"disabled\", \"disabled\");\n\n // Excludes the first dropdown list option from the options list\n self.selectItems = self.selectBox.find(\"option\").slice(1);\n\n }\n\n // Loops through the original select box options list and copies the text of each\n // into new list item elements of the new dropdown list\n self.selectItems.each(function(index) {\n\n currentOption = $(this);\n\n optgroupClass = \"\";\n\n optgroupElement = \"\";\n\n dataDisabled = currentOption.prop(\"disabled\");\n\n iconClass = currentOption.attr(\"data-icon\") || \"\";\n\n iconUrl = currentOption.attr(\"data-iconurl\") || \"\";\n\n iconUrlClass = iconUrl ? \"selectboxit-option-icon-url\": \"\";\n\n iconUrlStyle = iconUrl ? 'style=\"background-image:url(\\'' + iconUrl + '\\');\"': \"\";\n\n currentDataSelectedText = currentOption.attr(\"data-selectedtext\");\n\n currentDataText = currentOption.attr(\"data-text\");\n\n currentText = currentDataText ? currentDataText: currentOption.text();\n\n parent = currentOption.parent();\n\n // If the current option being traversed is within an optgroup\n\n if(parent.is(\"optgroup\")) {\n\n optgroupClass = \"selectboxit-optgroup-option\";\n\n if(currentOption.index() === 0) {\n\n optgroupElement = '' + parent.first().attr(\"label\") + '';\n\n }\n\n }\n\n currentOption.attr(\"value\", this.value);\n\n // Uses string concatenation for speed (applies HTML attribute encoding)\n currentItem += optgroupElement + '
  • ' + (self.options[\"html\"] ? currentText: self.htmlEscape(currentText)) + '
  • ';\n\n currentDataSearch = currentOption.attr(\"data-search\");\n\n // Stores all of the original select box options text inside of an array\n // (Used later in the `searchAlgorithm` method)\n self.textArray[index] = dataDisabled ? \"\": currentDataSearch ? currentDataSearch: currentText;\n\n // Checks the original select box option for the `selected` attribute\n if (this.selected) {\n\n // Replaces the default text with the selected option text\n self._setText(self.dropdownText, currentDataSelectedText || currentText);\n\n //Set the currently selected option\n self.currentFocus = index;\n\n }\n\n });\n\n // If the `defaultText` option is being used\n if ((self.options[\"defaultText\"] || self.selectBox.attr(\"data-text\"))) {\n\n var defaultedText = self.options[\"defaultText\"] || self.selectBox.attr(\"data-text\");\n\n // Overrides the current dropdown default text with the value the user specifies in the `defaultText` option\n self._setText(self.dropdownText, defaultedText);\n\n self.options[\"defaultText\"] = defaultedText;\n\n }\n\n // Append the list item to the unordered list\n createdList.append(currentItem);\n\n // Stores the dropdown list options list inside of the `list` instance variable\n self.list = createdList;\n\n // Append the dropdown list options list to the dropdown container element\n self.dropdownContainer.append(self.list);\n\n // Stores the individual dropdown list options inside of the `listItems` instance variable\n self.listItems = self.list.children(\"li\");\n\n self.listAnchors = self.list.find(\"a\");\n\n // Sets the 'selectboxit-option-first' class name on the first drop down option\n self.listItems.first().addClass(\"selectboxit-option-first\");\n\n // Sets the 'selectboxit-option-last' class name on the last drop down option\n self.listItems.last().addClass(\"selectboxit-option-last\");\n\n // Set the disabled CSS class for select box options\n self.list.find(\"li[data-disabled='true']\").not(\".optgroupHeader\").addClass(self.theme[\"disabled\"]);\n\n self.dropdownImage.addClass(self.selectBox.attr(\"data-icon\") || self.options[\"defaultIcon\"] || self.listItems.eq(self.currentFocus).find(\"i\").attr(\"class\"));\n\n self.dropdownImage.attr(\"style\", self.listItems.eq(self.currentFocus).find(\"i\").attr(\"style\"));\n\n //Maintains chainability\n return self;\n\n },\n\n // _Replace Select Box\n // -------------------\n // Hides the original dropdown list and inserts\n // the new DOM elements\n _replaceSelectBox: function() {\n\n var self = this,\n height,\n originalElemId = self.originalElem.id || \"\",\n size = self.selectBox.attr(\"data-size\"),\n listSize = self.listSize = size === undefined ? \"auto\" : size === \"0\" || \"size\" === \"auto\" ? \"auto\" : +size,\n downArrowContainerWidth,\n dropdownImageWidth;\n\n // Hides the original select box\n self.selectBox.css(\"display\", \"none\").\n\n // Adds the new dropdown list to the page directly after the hidden original select box element\n after(self.dropdownContainer);\n\n self.dropdownContainer.appendTo('body').\n\n addClass('selectboxit-rendering');\n\n // The height of the dropdown list\n height = self.dropdown.height();\n\n // The down arrow element of the dropdown list\n self.downArrow = $(\"\", {\n\n // Dynamically sets the dropdown `id` attribute of the dropdown list down arrow\n \"id\": originalElemId && originalElemId + \"SelectBoxItArrow\",\n\n \"class\": \"selectboxit-arrow\",\n\n // IE specific attribute to not allow the dropdown list text to be selected\n \"unselectable\": \"on\"\n\n });\n\n // The down arrow container element of the dropdown list\n self.downArrowContainer = $(\"\", {\n\n // Dynamically sets the dropdown `id` attribute for the down arrow container element\n \"id\": originalElemId && originalElemId + \"SelectBoxItArrowContainer\",\n\n \"class\": \"selectboxit-arrow-container\",\n\n // IE specific attribute to not allow the dropdown list text to be selected\n \"unselectable\": \"on\"\n\n }).\n\n // Inserts the down arrow element inside of the down arrow container element\n append(self.downArrow);\n\n // Appends the down arrow element to the dropdown list\n self.dropdown.append(self.downArrowContainer);\n\n // Adds the `selectboxit-selected` class name to the currently selected drop down option\n self.listItems.removeClass(\"selectboxit-selected\").eq(self.currentFocus).addClass(\"selectboxit-selected\");\n\n // The full outer width of the down arrow container\n downArrowContainerWidth = self.downArrowContainer.outerWidth(true);\n\n // The full outer width of the dropdown image\n dropdownImageWidth = self.dropdownImage.outerWidth(true);\n\n // If the `autoWidth` option is true\n if(self.options[\"autoWidth\"]) {\n\n // Sets the auto width of the drop down\n self.dropdown.css({ \"width\": \"auto\" }).css({\n\n \"width\": self.list.outerWidth(true) + downArrowContainerWidth + dropdownImageWidth\n\n });\n\n self.list.css({\n\n \"min-width\": self.dropdown.width()\n\n });\n\n }\n\n // Adds the new dropdown list to the page directly after the hidden original select box element\n self.selectBox.after(self.dropdownContainer);\n\n self.dropdownContainer.removeClass('selectboxit-rendering');\n\n // Fixes #255\n // Dynamically adds the `max-width` and `line-height` CSS styles of the dropdown list text element\n self.dropdownText.css({\n\n \"max-width\": self.dropdownContainer.outerWidth(true) - (downArrowContainerWidth + dropdownImageWidth)\n\n });\n\n if($.type(listSize) === \"number\") {\n\n // Stores the new `max-height` for later\n self.maxHeight = self.listAnchors.outerHeight(true) * listSize;\n\n }\n\n // Maintains chainability\n return self;\n\n },\n\n // _Scroll-To-View\n // ---------------\n // Updates the dropdown list scrollTop value\n _scrollToView: function(type) {\n\n var self = this,\n\n currentOption = self.listItems.eq(self.currentFocus),\n\n // The current scroll positioning of the dropdown list options list\n listScrollTop = self.list.scrollTop(),\n\n // The height of the currently selected dropdown list option\n currentItemHeight = currentOption.height(),\n\n // The relative distance from the currently selected dropdown list option to the the top of the dropdown list options list\n currentTopPosition = currentOption.position().top,\n\n absCurrentTopPosition = Math.abs(currentTopPosition),\n\n // The height of the dropdown list option list\n listHeight = self.list.height(),\n\n currentText;\n\n // Scrolling logic for a text search\n if (type === \"search\") {\n\n // Increases the dropdown list options `scrollTop` if a user is searching for an option\n // below the currently selected option that is not visible\n if (listHeight - currentTopPosition < currentItemHeight) {\n\n // The selected option will be shown at the very bottom of the visible options list\n self.list.scrollTop(listScrollTop + (currentTopPosition - (listHeight - currentItemHeight)));\n\n }\n\n // Decreases the dropdown list options `scrollTop` if a user is searching for an option above the currently selected option that is not visible\n else if (currentTopPosition < -1) {\n\n self.list.scrollTop(currentTopPosition - currentItemHeight);\n\n }\n }\n\n // Scrolling logic for the `up` keyboard navigation\n else if (type === \"up\") {\n\n // Decreases the dropdown list option list `scrollTop` if a user is navigating to an element that is not visible\n if (currentTopPosition < -1) {\n\n self.list.scrollTop(listScrollTop - absCurrentTopPosition);\n\n }\n }\n\n // Scrolling logic for the `down` keyboard navigation\n else if (type === \"down\") {\n\n // Increases the dropdown list options `scrollTop` if a user is navigating to an element that is not fully visible\n if (listHeight - currentTopPosition < currentItemHeight) {\n\n // Increases the dropdown list options `scrollTop` by the height of the current option item.\n self.list.scrollTop((listScrollTop + (absCurrentTopPosition - listHeight + currentItemHeight)));\n\n }\n }\n\n // Maintains chainability\n return self;\n\n },\n\n // _Callback\n // ---------\n // Call the function passed into the method\n _callbackSupport: function(callback) {\n\n var self = this;\n\n // Checks to make sure the parameter passed in is a function\n if ($.isFunction(callback)) {\n\n // Calls the method passed in as a parameter and sets the current `SelectBoxIt` object that is stored in the jQuery data method as the context(allows for `this` to reference the SelectBoxIt API Methods in the callback function. The `dropdown` DOM element that acts as the new dropdown list is also passed as the only parameter to the callback\n callback.call(self, self.dropdown);\n\n }\n\n // Maintains chainability\n return self;\n\n },\n\n // _setText\n // --------\n // Set's the text or html for the drop down\n _setText: function(elem, currentText) {\n\n var self = this;\n\n if(self.options[\"html\"]) {\n\n elem.html(currentText);\n\n }\n\n else {\n\n elem.text(currentText);\n\n }\n\n return self;\n\n },\n\n // Open\n // ----\n // Opens the dropdown list options list\n open: function(callback) {\n\n var self = this,\n showEffect = self.options[\"showEffect\"],\n showEffectSpeed = self.options[\"showEffectSpeed\"],\n showEffectOptions = self.options[\"showEffectOptions\"],\n isNative = self.options[\"native\"],\n isMobile = self.isMobile;\n\n // If there are no select box options, do not try to open the select box\n if(!self.listItems.length || self.dropdown.hasClass(self.theme[\"disabled\"])) {\n\n return self;\n\n }\n\n // If the new drop down is being used and is not visible\n if((!isNative && !isMobile) && !this.list.is(\":visible\")) {\n\n // Triggers a custom \"open\" event on the original select box\n self.triggerEvent(\"open\");\n\n if (self._dynamicPositioning && self.options[\"dynamicPositioning\"]) {\n\n // Dynamically positions the dropdown list options list\n self._dynamicPositioning();\n\n }\n\n // Uses `no effect`\n if(showEffect === \"none\") {\n\n // Does not require a callback function because this animation will complete before the call to `scrollToView`\n self.list.show();\n\n }\n\n // Uses the jQuery `show` special effect\n else if(showEffect === \"show\" || showEffect === \"slideDown\" || showEffect === \"fadeIn\") {\n\n // Requires a callback function to determine when the `show` animation is complete\n self.list[showEffect](showEffectSpeed);\n\n }\n\n // If none of the above options were passed, then a `jqueryUI show effect` is expected\n else {\n\n // Allows for custom show effects via the [jQueryUI core effects](http://http://jqueryui.com/demos/show/)\n self.list.show(showEffect, showEffectOptions, showEffectSpeed);\n\n }\n\n self.list.promise().done(function() {\n\n // Updates the list `scrollTop` attribute\n self._scrollToView(\"search\");\n\n // Triggers a custom \"opened\" event when the drop down list is done animating\n self.triggerEvent(\"opened\");\n\n });\n\n }\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n },\n\n // Close\n // -----\n // Closes the dropdown list options list\n close: function(callback) {\n\n var self = this,\n hideEffect = self.options[\"hideEffect\"],\n hideEffectSpeed = self.options[\"hideEffectSpeed\"],\n hideEffectOptions = self.options[\"hideEffectOptions\"],\n isNative = self.options[\"native\"],\n isMobile = self.isMobile;\n\n // If the drop down is being used and is visible\n if((!isNative && !isMobile) && self.list.is(\":visible\")) {\n\n // Triggers a custom \"close\" event on the original select box\n self.triggerEvent(\"close\");\n\n // Uses `no effect`\n if(hideEffect === \"none\") {\n\n // Does not require a callback function because this animation will complete before the call to `scrollToView`\n self.list.hide();\n\n }\n\n // Uses the jQuery `hide` special effect\n else if(hideEffect === \"hide\" || hideEffect === \"slideUp\" || hideEffect === \"fadeOut\") {\n\n self.list[hideEffect](hideEffectSpeed);\n\n }\n\n // If none of the above options were passed, then a `jqueryUI hide effect` is expected\n else {\n\n // Allows for custom hide effects via the [jQueryUI core effects](http://http://jqueryui.com/demos/hide/)\n self.list.hide(hideEffect, hideEffectOptions, hideEffectSpeed);\n\n }\n\n // After the drop down list is done animating\n self.list.promise().done(function() {\n\n // Triggers a custom \"closed\" event when the drop down list is done animating\n self.triggerEvent(\"closed\");\n\n });\n\n }\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n },\n\n toggle: function() {\n\n var self = this,\n listIsVisible = self.list.is(\":visible\");\n\n if(listIsVisible) {\n\n self.close();\n\n }\n\n else if(!listIsVisible) {\n\n self.open();\n\n }\n\n },\n\n // _Key Mappings\n // -------------\n // Object literal holding the string representation of each key code\n _keyMappings: {\n\n \"38\": \"up\",\n\n \"40\": \"down\",\n\n \"13\": \"enter\",\n\n \"8\": \"backspace\",\n\n \"9\": \"tab\",\n\n \"32\": \"space\",\n\n \"27\": \"esc\"\n\n },\n\n // _Key Down Methods\n // -----------------\n // Methods to use when the keydown event is triggered\n _keydownMethods: function() {\n\n var self = this,\n moveToOption = self.list.is(\":visible\") || !self.options[\"keydownOpen\"];\n\n return {\n\n \"down\": function() {\n\n // If the plugin options allow keyboard navigation\n if (self.moveDown && moveToOption) {\n\n self.moveDown();\n\n }\n\n },\n\n \"up\": function() {\n\n // If the plugin options allow keyboard navigation\n if (self.moveUp && moveToOption) {\n\n self.moveUp();\n\n }\n\n },\n\n \"enter\": function() {\n\n var activeElem = self.listItems.eq(self.currentFocus);\n\n // Updates the dropdown list value\n self._update(activeElem);\n\n if (activeElem.attr(\"data-preventclose\") !== \"true\") {\n\n // Closes the drop down list options list\n self.close();\n\n }\n\n // Triggers the `enter` events on the original select box\n self.triggerEvent(\"enter\");\n\n },\n\n \"tab\": function() {\n\n // Triggers the custom `tab-blur` event on the original select box\n self.triggerEvent(\"tab-blur\");\n\n // Closes the drop down list\n self.close();\n\n },\n\n \"backspace\": function() {\n\n // Triggers the custom `backspace` event on the original select box\n self.triggerEvent(\"backspace\");\n\n },\n\n \"esc\": function() {\n\n // Closes the dropdown options list\n self.close();\n\n }\n\n };\n\n },\n\n\n // _Event Handlers\n // ---------------\n // Adds event handlers to the new dropdown and the original select box\n _eventHandlers: function() {\n\n // LOCAL VARIABLES\n var self = this,\n nativeMousedown = self.options[\"nativeMousedown\"],\n customShowHideEvent = self.options[\"customShowHideEvent\"],\n currentDataText,\n currentText,\n focusClass = self.focusClass,\n hoverClass = self.hoverClass,\n openClass = self.openClass;\n\n // Select Box events\n this.dropdown.on({\n\n // `click` event with the `selectBoxIt` namespace\n \"click.selectBoxIt\": function() {\n\n // Used to make sure the dropdown becomes focused (fixes IE issue)\n self.dropdown.trigger(\"focus\", true);\n\n // The `click` handler logic will only be applied if the dropdown list is enabled\n if (!self.originalElem.disabled) {\n\n // Triggers the `click` event on the original select box\n self.triggerEvent(\"click\");\n\n if(!nativeMousedown && !customShowHideEvent) {\n\n self.toggle();\n\n }\n\n }\n\n },\n\n // `mousedown` event with the `selectBoxIt` namespace\n \"mousedown.selectBoxIt\": function() {\n\n // Stores data in the jQuery `data` method to help determine if the dropdown list gains focus from a click or tabstop. The mousedown event fires before the focus event.\n $(this).data(\"mdown\", true);\n\n self.triggerEvent(\"mousedown\");\n\n if(nativeMousedown && !customShowHideEvent) {\n\n self.toggle();\n\n }\n\n },\n\n // `mouseup` event with the `selectBoxIt` namespace\n \"mouseup.selectBoxIt\": function() {\n\n self.triggerEvent(\"mouseup\");\n\n },\n\n // `blur` event with the `selectBoxIt` namespace. Uses special blur logic to make sure the dropdown list closes correctly\n \"blur.selectBoxIt\": function() {\n\n // If `self.blur` property is true\n if (self.blur) {\n\n // Triggers both the `blur` and `focusout` events on the original select box.\n // The `focusout` event is also triggered because the event bubbles\n // This event has to be used when using event delegation (such as the jQuery `delegate` or `on` methods)\n // Popular open source projects such as Backbone.js utilize event delegation to bind events, so if you are using Backbone.js, use the `focusout` event instead of the `blur` event\n self.triggerEvent(\"blur\");\n\n // Closes the dropdown list options list\n self.close();\n\n $(this).removeClass(focusClass);\n\n }\n\n },\n\n \"focus.selectBoxIt\": function(event, internal) {\n\n // Stores the data associated with the mousedown event inside of a local variable\n var mdown = $(this).data(\"mdown\");\n\n // Removes the jQuery data associated with the mousedown event\n $(this).removeData(\"mdown\");\n\n // If a mousedown event did not occur and no data was passed to the focus event (this correctly triggers the focus event), then the dropdown list gained focus from a tabstop\n if (!mdown && !internal) {\n\n setTimeout(function() {\n\n // Triggers the `tabFocus` custom event on the original select box\n self.triggerEvent(\"tab-focus\");\n\n }, 0);\n\n }\n\n // Only trigger the `focus` event on the original select box if the dropdown list is hidden (this verifies that only the correct `focus` events are used to trigger the event on the original select box\n if(!internal) {\n\n if(!$(this).hasClass(self.theme[\"disabled\"])) {\n\n $(this).addClass(focusClass);\n\n }\n\n //Triggers the `focus` default event on the original select box\n self.triggerEvent(\"focus\");\n\n }\n\n },\n\n // `keydown` event with the `selectBoxIt` namespace. Catches all user keyboard navigations\n \"keydown.selectBoxIt\": function(e) {\n\n // Stores the `keycode` value in a local variable\n var currentKey = self._keyMappings[e.keyCode],\n\n keydownMethod = self._keydownMethods()[currentKey];\n\n if(keydownMethod) {\n\n keydownMethod();\n\n if(self.options[\"keydownOpen\"] && (currentKey === \"up\" || currentKey === \"down\")) {\n\n self.open();\n\n }\n\n }\n\n if(keydownMethod && currentKey !== \"tab\") {\n\n e.preventDefault();\n\n }\n\n },\n\n // `keypress` event with the `selectBoxIt` namespace. Catches all user keyboard text searches since you can only reliably get character codes using the `keypress` event\n \"keypress.selectBoxIt\": function(e) {\n\n if (!self.originalElem.disabled) {\n // Sets the current key to the `keyCode` value if `charCode` does not exist. Used for cross\n // browser support since IE uses `keyCode` instead of `charCode`.\n var currentKey = e.charCode || e.keyCode,\n\n key = self._keyMappings[e.charCode || e.keyCode],\n\n // Converts unicode values to characters\n alphaNumericKey = String.fromCharCode(currentKey);\n\n // If the plugin options allow text searches\n if (self.search && (!key || (key && key === \"space\"))) {\n\n // Calls `search` and passes the character value of the user's text search\n self.search(alphaNumericKey, true, true);\n\n }\n\n if(key === \"space\") {\n\n e.preventDefault();\n\n }\n }\n },\n\n // `mousenter` event with the `selectBoxIt` namespace .The mouseenter JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser.\n \"mouseenter.selectBoxIt\": function() {\n\n // Trigger the `mouseenter` event on the original select box\n self.triggerEvent(\"mouseenter\");\n\n },\n\n // `mouseleave` event with the `selectBoxIt` namespace. The mouseleave JavaScript event is proprietary to Internet Explorer. Because of the event's general utility, jQuery simulates this event so that it can be used regardless of browser.\n \"mouseleave.selectBoxIt\": function() {\n\n // Trigger the `mouseleave` event on the original select box\n self.triggerEvent(\"mouseleave\");\n\n }\n\n });\n\n // Select box options events that set the dropdown list blur logic (decides when the dropdown list gets\n // closed)\n self.list.on({\n\n // `mouseover` event with the `selectBoxIt` namespace\n \"mouseover.selectBoxIt\": function() {\n\n // Prevents the dropdown list options list from closing\n self.blur = false;\n\n },\n\n // `mouseout` event with the `selectBoxIt` namespace\n \"mouseout.selectBoxIt\": function() {\n\n // Allows the dropdown list options list to close\n self.blur = true;\n\n },\n\n // `focusin` event with the `selectBoxIt` namespace\n \"focusin.selectBoxIt\": function() {\n\n // Prevents the default browser outline border to flicker, which results because of the `blur` event\n self.dropdown.trigger(\"focus\", true);\n\n }\n\n });\n\n // Select box individual options events bound with the jQuery `delegate` method. `Delegate` was used because binding indropdownidual events to each list item (since we don't know how many there will be) would decrease performance. Instead, we bind each event to the unordered list, provide the list item context, and allow the list item events to bubble up (`event bubbling`). This greatly increases page performance because we only have to bind an event to one element instead of x number of elements. Delegates the `click` event with the `selectBoxIt` namespace to the list items\n self.list.on({\n\n \"mousedown.selectBoxIt\": function() {\n\n self._update($(this));\n\n self.triggerEvent(\"option-click\");\n\n // If the current drop down option is not disabled\n if ($(this).attr(\"data-disabled\") === \"false\" && $(this).attr(\"data-preventclose\") !== \"true\") {\n\n // Closes the drop down list\n self.close();\n\n }\n\n setTimeout(function() {\n\n self.dropdown.trigger('focus', true);\n\n }, 0);\n\n },\n\n // Delegates the `focusin` event with the `selectBoxIt` namespace to the list items\n \"focusin.selectBoxIt\": function() {\n\n // Removes the hover class from the previous drop down option\n self.listItems.not($(this)).removeAttr(\"data-active\");\n\n $(this).attr(\"data-active\", \"\");\n\n var listIsHidden = self.list.is(\":hidden\");\n\n if((self.options[\"searchWhenHidden\"] && listIsHidden) || self.options[\"aggressiveChange\"] || (listIsHidden && self.options[\"selectWhenHidden\"])) {\n\n self._update($(this));\n\n }\n\n // Adds the focus CSS class to the currently focused dropdown list option\n $(this).addClass(focusClass);\n\n },\n\n // Delegates the `focus` event with the `selectBoxIt` namespace to the list items\n \"mouseup.selectBoxIt\": function() {\n\n if(nativeMousedown && !customShowHideEvent) {\n\n self._update($(this));\n\n self.triggerEvent(\"option-mouseup\");\n\n // If the current drop down option is not disabled\n if ($(this).attr(\"data-disabled\") === \"false\" && $(this).attr(\"data-preventclose\") !== \"true\") {\n\n // Closes the drop down list\n self.close();\n\n }\n\n }\n\n },\n\n // Delegates the `mouseenter` event with the `selectBoxIt` namespace to the list items\n \"mouseenter.selectBoxIt\": function() {\n\n // If the currently moused over drop down option is not disabled\n if($(this).attr(\"data-disabled\") === \"false\") {\n\n self.listItems.removeAttr(\"data-active\");\n\n $(this).addClass(focusClass).attr(\"data-active\", \"\");\n\n // Sets the dropdown list indropdownidual options back to the default state and sets the focus CSS class on the currently hovered option\n self.listItems.not($(this)).removeClass(focusClass);\n\n $(this).addClass(focusClass);\n\n self.currentFocus = +$(this).attr(\"data-id\");\n\n }\n\n },\n\n // Delegates the `mouseleave` event with the `selectBoxIt` namespace to the list items\n \"mouseleave.selectBoxIt\": function() {\n\n // If the currently moused over drop down option is not disabled\n if($(this).attr(\"data-disabled\") === \"false\") {\n\n // Removes the focus class from the previous drop down option\n self.listItems.not($(this)).removeClass(focusClass).removeAttr(\"data-active\");\n\n $(this).addClass(focusClass);\n\n self.currentFocus = +$(this).attr(\"data-id\");\n\n }\n\n },\n\n // Delegates the `blur` event with the `selectBoxIt` namespace to the list items\n \"blur.selectBoxIt\": function() {\n\n // Removes the focus CSS class from the previously focused dropdown list option\n $(this).removeClass(focusClass);\n\n }\n\n }, \".selectboxit-option\");\n\n // Select box individual option anchor events bound with the jQuery `delegate` method. `Delegate` was used because binding indropdownidual events to each list item (since we don't know how many there will be) would decrease performance. Instead, we bind each event to the unordered list, provide the list item context, and allow the list item events to bubble up (`event bubbling`). This greatly increases page performance because we only have to bind an event to one element instead of x number of elements. Delegates the `click` event with the `selectBoxIt` namespace to the list items\n self.list.on({\n\n \"click.selectBoxIt\": function(ev) {\n\n // Prevents the internal anchor tag from doing anything funny\n ev.preventDefault();\n\n }\n\n }, \"a\");\n\n // Original dropdown list events\n self.selectBox.on({\n\n // `change` event handler with the `selectBoxIt` namespace\n \"change.selectBoxIt, internal-change.selectBoxIt\": function(event, internal) {\n\n var currentOption,\n currentDataSelectedText;\n\n // If the user called the change method\n if(!internal) {\n\n currentOption = self.list.find('li[data-val=\"' + self.originalElem.value + '\"]');\n\n // If there is a dropdown option with the same value as the original select box element\n if(currentOption.length) {\n\n self.listItems.eq(self.currentFocus).removeClass(self.focusClass);\n\n self.currentFocus = +currentOption.attr(\"data-id\");\n\n }\n\n }\n\n currentOption = self.listItems.eq(self.currentFocus);\n\n currentDataSelectedText = currentOption.attr(\"data-selectedtext\");\n\n currentDataText = currentOption.attr(\"data-text\");\n\n currentText = currentDataText ? currentDataText: currentOption.find(\"a\").text();\n\n // Sets the new dropdown list text to the value of the current option\n self._setText(self.dropdownText, currentDataSelectedText || currentText);\n\n self.dropdownText.attr(\"data-val\", self.originalElem.value);\n\n if(currentOption.find(\"i\").attr(\"class\")) {\n\n self.dropdownImage.attr(\"class\", currentOption.find(\"i\").attr(\"class\")).addClass(\"selectboxit-default-icon\");\n\n self.dropdownImage.attr(\"style\", currentOption.find(\"i\").attr(\"style\"));\n }\n\n // Triggers a custom changed event on the original select box\n self.triggerEvent(\"changed\");\n\n },\n\n // `disable` event with the `selectBoxIt` namespace\n \"disable.selectBoxIt\": function() {\n\n // Adds the `disabled` CSS class to the new dropdown list to visually show that it is disabled\n self.dropdown.addClass(self.theme[\"disabled\"]);\n\n },\n\n // `enable` event with the `selectBoxIt` namespace\n \"enable.selectBoxIt\": function() {\n\n // Removes the `disabled` CSS class from the new dropdown list to visually show that it is enabled\n self.dropdown.removeClass(self.theme[\"disabled\"]);\n\n },\n\n // `open` event with the `selectBoxIt` namespace\n \"open.selectBoxIt\": function() {\n\n var currentElem = self.list.find(\"li[data-val='\" + self.dropdownText.attr(\"data-val\") + \"']\"),\n activeElem;\n\n // If no current element can be found, then select the first drop down option\n if(!currentElem.length) {\n\n // Sets the default value of the dropdown list to the first option that is not disabled\n currentElem = self.listItems.not(\"[data-disabled=true]\").first();\n\n }\n\n self.currentFocus = +currentElem.attr(\"data-id\");\n\n activeElem = self.listItems.eq(self.currentFocus);\n\n self.dropdown.addClass(openClass).\n\n // Removes the focus class from the dropdown list and adds the library focus class for both the dropdown list and the currently selected dropdown list option\n removeClass(hoverClass).addClass(focusClass);\n\n self.listItems.removeClass(self.selectedClass).\n\n removeAttr(\"data-active\").not(activeElem).removeClass(focusClass);\n\n activeElem.addClass(self.selectedClass).addClass(focusClass);\n\n if(self.options.hideCurrent) {\n activeElem.hide().promise().done(function () {\n self.listItems.show();\n });\n }\n\n },\n\n \"close.selectBoxIt\": function() {\n\n // Removes the open class from the dropdown container\n self.dropdown.removeClass(openClass);\n\n },\n\n \"blur.selectBoxIt\": function() {\n\n self.dropdown.removeClass(focusClass);\n\n },\n\n // `mousenter` event with the `selectBoxIt` namespace\n \"mouseenter.selectBoxIt\": function() {\n\n if(!$(this).hasClass(self.theme[\"disabled\"])) {\n self.dropdown.addClass(hoverClass);\n }\n\n },\n\n // `mouseleave` event with the `selectBoxIt` namespace\n \"mouseleave.selectBoxIt\": function() {\n\n // Removes the hover CSS class on the previously hovered dropdown list option\n self.dropdown.removeClass(hoverClass);\n\n },\n\n // `destroy` event\n \"destroy\": function(ev) {\n\n // Prevents the default action from happening\n ev.preventDefault();\n\n // Prevents the destroy event from propagating\n ev.stopPropagation();\n\n }\n\n });\n\n // Maintains chainability\n return self;\n\n },\n\n // _update\n // -------\n // Updates the drop down and select box with the current value\n _update: function(elem) {\n\n var self = this,\n currentDataSelectedText,\n currentDataText,\n currentText,\n defaultText = self.options[\"defaultText\"] || self.selectBox.attr(\"data-text\"),\n currentElem = self.listItems.eq(self.currentFocus);\n\n if (elem.attr(\"data-disabled\") === \"false\") {\n\n currentDataSelectedText = self.listItems.eq(self.currentFocus).attr(\"data-selectedtext\");\n\n currentDataText = currentElem.attr(\"data-text\");\n\n currentText = currentDataText ? currentDataText: currentElem.text();\n\n // If the default text option is set and the current drop down option is not disabled\n if ((defaultText && self.options[\"html\"] ? self.dropdownText.html() === defaultText: self.dropdownText.text() === defaultText) && self.selectBox.val() === elem.attr(\"data-val\")) {\n\n self.triggerEvent(\"change\");\n\n }\n\n else {\n\n // Sets the original dropdown list value and triggers the `change` event on the original select box\n self.selectBox.val(elem.attr(\"data-val\"));\n\n // Sets `currentFocus` to the currently focused dropdown list option.\n // The unary `+` operator casts the string to a number\n // [James Padolsey Blog Post](http://james.padolsey.com/javascript/terse-javascript-101-part-2/)\n self.currentFocus = +elem.attr(\"data-id\");\n\n // Triggers the dropdown list `change` event if a value change occurs\n if (self.originalElem.value !== self.dropdownText.attr(\"data-val\")) {\n\n self.triggerEvent(\"change\");\n\n }\n\n }\n\n }\n\n },\n\n // _addClasses\n // -----------\n // Adds SelectBoxIt CSS classes\n _addClasses: function(obj) {\n\n var self = this,\n\n focusClass = self.focusClass = obj.focus,\n\n hoverClass = self.hoverClass = obj.hover,\n\n buttonClass = obj.button,\n\n listClass = obj.list,\n\n arrowClass = obj.arrow,\n\n containerClass = obj.container,\n\n openClass = self.openClass = obj.open;\n\n self.selectedClass = \"selectboxit-selected\";\n\n self.downArrow.addClass(self.selectBox.attr(\"data-downarrow\") || self.options[\"downArrowIcon\"] || arrowClass);\n\n // Adds the correct container class to the dropdown list\n self.dropdownContainer.addClass(containerClass);\n\n // Adds the correct class to the dropdown list\n self.dropdown.addClass(buttonClass);\n\n // Adds the default class to the dropdown list options\n self.list.addClass(listClass);\n\n // Maintains chainability\n return self;\n\n },\n\n // Refresh\n // -------\n // The dropdown will rebuild itself. Useful for dynamic content.\n refresh: function(callback, internal) {\n\n var self = this;\n\n // Destroys the plugin and then recreates the plugin\n self._destroySelectBoxIt()._create(true);\n\n if(!internal) {\n self.triggerEvent(\"refresh\");\n }\n\n self._callbackSupport(callback);\n\n //Maintains chainability\n return self;\n\n },\n\n // HTML Escape\n // -----------\n // HTML encodes a string\n htmlEscape: function(str) {\n\n return String(str)\n .replace(/&/g, \"&\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\")\n .replace(//g, \">\");\n\n },\n\n // triggerEvent\n // ------------\n // Trigger's an external event on the original select box element\n triggerEvent: function(eventName) {\n\n var self = this,\n // Finds the currently option index\n currentIndex = self.options[\"showFirstOption\"] ? self.currentFocus : ((self.currentFocus - 1) >= 0 ? self.currentFocus: 0);\n\n // Triggers the custom option-click event on the original select box and passes the select box option\n self.selectBox.trigger(eventName, { \"selectbox\": self.selectBox, \"selectboxOption\": self.selectItems.eq(currentIndex), \"dropdown\": self.dropdown, \"dropdownOption\": self.listItems.eq(self.currentFocus) });\n\n // Maintains chainability\n return self;\n\n },\n\n // _copyAttributes\n // ---------------\n // Copies HTML attributes from the original select box to the new drop down \n _copyAttributes: function() {\n\n var self = this;\n\n if(self._addSelectBoxAttributes) {\n\n self._addSelectBoxAttributes();\n\n }\n\n return self;\n\n },\n\n // _realOuterWidth\n // ---------------\n // Retrieves the true outerWidth dimensions of a hidden DOM element\n _realOuterWidth: function(elem) {\n\n if(elem.is(\":visible\")) {\n\n return elem.outerWidth(true);\n\n }\n\n var self = this,\n clonedElem = elem.clone(),\n outerWidth;\n\n clonedElem.css({\n\n \"visibility\": \"hidden\",\n\n \"display\": \"block\",\n\n \"position\": \"absolute\"\n\n }).appendTo(\"body\");\n\n outerWidth = clonedElem.outerWidth(true);\n\n clonedElem.remove();\n\n return outerWidth;\n }\n\n });\n\n // Stores the plugin prototype object in a local variable\n var selectBoxIt = $.selectBox.selectBoxIt.prototype;\n\n // Accessibility Module\n // ====================\n\n // _ARIA Accessibility\n // ------------------\n // Adds ARIA (Accessible Rich Internet Applications)\n // Accessibility Tags to the Select Box\n\n selectBoxIt._ariaAccessibility = function() {\n\n var self = this,\n dropdownLabel = $(\"label[for='\" + self.originalElem.id + \"']\");\n\n // Adds `ARIA attributes` to the dropdown list\n self.dropdownContainer.attr({\n\n // W3C `combobox` description: A presentation of a select; usually similar to a textbox where users can type ahead to select an option.\n \"role\": \"combobox\",\n\n \"aria-haspopup\": \"true\",\n\n // W3C `aria-expanded` description: Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.\n \"aria-expanded\": \"false\",\n\n // W3C `aria-owns` description: The value of the aria-owns attribute is a space-separated list of IDREFS that reference one or more elements in the document by ID. The reason for adding aria-owns is to expose a parent/child contextual relationship to assistive technologies that is otherwise impossible to infer from the DOM.\n \"aria-owns\": self.list[0].id\n\n });\n\n self.dropdownText.attr({\n\n \"aria-live\": \"polite\"\n\n });\n\n // Dynamically adds `ARIA attributes` if the new dropdown list is enabled or disabled\n self.dropdown.on({\n\n //Select box custom `disable` event with the `selectBoxIt` namespace\n \"disable.selectBoxIt\" : function() {\n\n // W3C `aria-disabled` description: Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n self.dropdownContainer.attr(\"aria-disabled\", \"true\");\n\n },\n\n // Select box custom `enable` event with the `selectBoxIt` namespace\n \"enable.selectBoxIt\" : function() {\n\n // W3C `aria-disabled` description: Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n self.dropdownContainer.attr(\"aria-disabled\", \"false\");\n\n }\n\n });\n\n if(dropdownLabel.length) {\n\n // MDN `aria-labelledby` description: Indicates the IDs of the elements that are the labels for the object.\n self.dropdownContainer.attr(\"aria-labelledby\", dropdownLabel[0].id);\n\n }\n\n // Adds ARIA attributes to the dropdown list options list\n self.list.attr({\n\n // W3C `listbox` description: A widget that allows the user to select one or more items from a list of choices.\n \"role\": \"listbox\",\n\n // Indicates that the dropdown list options list is currently hidden\n \"aria-hidden\": \"true\"\n\n });\n\n // Adds `ARIA attributes` to the dropdown list options\n self.listItems.attr({\n\n // This must be set for each element when the container element role is set to `listbox`\n \"role\": \"option\"\n\n });\n\n // Dynamically updates the new dropdown list `aria-label` attribute after the original dropdown list value changes\n self.selectBox.on({\n\n // Custom `open` event with the `selectBoxIt` namespace\n \"open.selectBoxIt\": function() {\n\n // Indicates that the dropdown list options list is currently visible\n self.list.attr(\"aria-hidden\", \"false\");\n\n // Indicates that the dropdown list is currently expanded\n self.dropdownContainer.attr(\"aria-expanded\", \"true\");\n\n },\n\n // Custom `close` event with the `selectBoxIt` namespace\n \"close.selectBoxIt\": function() {\n\n // Indicates that the dropdown list options list is currently hidden\n self.list.attr(\"aria-hidden\", \"true\");\n\n // Indicates that the dropdown list is currently collapsed\n self.dropdownContainer.attr(\"aria-expanded\", \"false\");\n\n }\n\n });\n\n // Maintains chainability\n return self;\n\n };\n // Copy Attributes Module\n // ======================\n\n // addSelectBoxAttributes\n // ----------------------\n // Add's all attributes (excluding id, class names, and the style attribute) from the default select box to the new drop down\n\n selectBoxIt._addSelectBoxAttributes = function() {\n\n // Stores the plugin context inside of the self variable\n var self = this;\n\n // Add's all attributes to the currently traversed drop down option\n self._addAttributes(self.selectBox.prop(\"attributes\"), self.dropdown);\n\n // Add's all attributes to the drop down items list\n self.selectItems.each(function(iterator) {\n\n // Add's all attributes to the currently traversed drop down option\n self._addAttributes($(this).prop(\"attributes\"), self.listItems.eq(iterator));\n\n });\n\n // Maintains chainability\n return self;\n\n };\n\n // addAttributes\n // -------------\n // Add's attributes to a DOM element\n selectBoxIt._addAttributes = function(arr, elem) {\n\n // Stores the plugin context inside of the self variable\n var self = this,\n whitelist = self.options[\"copyAttributes\"],\n blacklist = self.options[\"dontCopyAttributes\"];\n\n\n // If there are array properties\n if(arr.length) {\n\n // Iterates over all of array properties\n $.each(arr, function(iterator, property) {\n\n // Get's the property name and property value of each property\n var propName = (property.name).toLowerCase(), propValue = property.value;\n\n // If the currently traversed property is in the blacklist\n if($.inArray(propName, blacklist) !== -1) {\n\n return;\n\n }\n \n // If the currently traversed property value is not \"null\", is on the whitelist, or is an HTML 5 data attribute\n if(propValue !== \"null\" && ($.inArray(propName, whitelist) !== -1 || propName.indexOf(\"data\") !== -1)) {\n\n // Set's the currently traversed property on element\n elem.attr(propName, propValue);\n\n }\n\n });\n\n }\n\n // Maintains chainability\n return self;\n\n };\n// Destroy Module\n// ==============\n\n// Destroy\n// -------\n// Removes the plugin from the page\n\nselectBoxIt.destroy = function(callback) {\n\n // Stores the plugin context inside of the self variable\n var self = this;\n\n self._destroySelectBoxIt();\n\n // Calls the jQueryUI Widget Factory destroy method\n self.widgetProto.destroy.call(self);\n\n // Provides callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n};\n\n// Internal Destroy Method\n// -----------------------\n// Removes the plugin from the page\n\nselectBoxIt._destroySelectBoxIt = function() {\n\n // Stores the plugin context inside of the self variable\n var self = this;\n\n // Unbinds all of the dropdown list event handlers with the `selectBoxIt` namespace\n self.dropdown.off(\".selectBoxIt\");\n\n // If the original select box has been placed inside of the new drop down container\n if ($.contains(self.dropdownContainer[0], self.originalElem)) {\n\n // Moves the original select box before the drop down container\n self.dropdownContainer.before(self.selectBox);\n\n }\n\n // Remove all of the `selectBoxIt` DOM elements from the page\n self.dropdownContainer.remove();\n\n // Resets the style attributes for the original select box\n self.selectBox.removeAttr(\"style\").attr(\"style\", self.selectBoxStyles);\n\n // Triggers the custom `destroy` event on the original select box\n self.triggerEvent(\"destroy\");\n\n // Maintains chainability\n return self;\n\n};\n // Disable Module\n // ==============\n\n // Disable\n // -------\n // Disables the new dropdown list\n\n selectBoxIt.disable = function(callback) {\n\n var self = this;\n\n if(!self.options[\"disabled\"]) {\n\n // Makes sure the dropdown list is closed\n self.close();\n\n // Sets the `disabled` attribute on the original select box\n self.selectBox.attr(\"disabled\", \"disabled\");\n\n // Makes the dropdown list not focusable by removing the `tabindex` attribute\n self.dropdown.removeAttr(\"tabindex\").\n\n // Disables styling for enabled state\n removeClass(self.theme[\"enabled\"]).\n\n // Enabled styling for disabled state\n addClass(self.theme[\"disabled\"]);\n\n self._setOption(\"disabled\", true);\n\n // Triggers a `disable` custom event on the original select box\n self.triggerEvent(\"disable\");\n\n }\n\n // Provides callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n\n // Disable Option\n // --------------\n // Disables a single drop down option\n\n selectBoxIt.disableOption = function(index, callback) {\n\n var self = this, currentSelectBoxOption, hasNextEnabled, hasPreviousEnabled, type = $.type(index);\n\n // If an index is passed to target an indropdownidual drop down option\n if(type === \"number\") {\n\n // Makes sure the dropdown list is closed\n self.close();\n\n // The select box option being targeted\n currentSelectBoxOption = self.selectBox.find(\"option\").eq(index);\n\n // Triggers a `disable-option` custom event on the original select box and passes the disabled option\n self.triggerEvent(\"disable-option\");\n\n // Disables the targeted select box option\n currentSelectBoxOption.attr(\"disabled\", \"disabled\");\n\n // Disables the drop down option\n self.listItems.eq(index).attr(\"data-disabled\", \"true\").\n\n // Applies disabled styling for the drop down option\n addClass(self.theme[\"disabled\"]);\n\n // If the currently selected drop down option is the item being disabled\n if(self.currentFocus === index) {\n\n hasNextEnabled = self.listItems.eq(self.currentFocus).nextAll(\"li\").not(\"[data-disabled='true']\").first().length;\n\n hasPreviousEnabled = self.listItems.eq(self.currentFocus).prevAll(\"li\").not(\"[data-disabled='true']\").first().length;\n\n // If there is a currently enabled option beneath the currently selected option\n if(hasNextEnabled) {\n\n // Selects the option beneath the currently selected option\n self.moveDown();\n\n }\n\n // If there is a currently enabled option above the currently selected option\n else if(hasPreviousEnabled) {\n\n // Selects the option above the currently selected option\n self.moveUp();\n\n }\n\n // If there is not a currently enabled option\n else {\n\n // Disables the entire drop down list\n self.disable();\n\n }\n\n }\n\n }\n\n // Provides callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n\n // _Is Disabled\n // -----------\n // Checks the original select box for the\n // disabled attribute\n\n selectBoxIt._isDisabled = function(callback) {\n\n var self = this;\n\n // If the original select box is disabled\n if (self.originalElem.disabled) {\n\n // Disables the dropdown list\n self.disable();\n\n }\n\n // Maintains chainability\n return self;\n\n };\n // Dynamic Positioning Module\n // ==========================\n\n // _Dynamic positioning\n // --------------------\n // Dynamically positions the dropdown list options list\n\n selectBoxIt._dynamicPositioning = function() {\n\n var self = this;\n var openUpClassName = 'selectboxit-open-up';\n var openDownClassName = 'selectboxit-open-down';\n\n // If the `size` option is a number\n if($.type(self.listSize) === \"number\") {\n\n // Set's the max-height of the drop down list\n self.list.css(\"max-height\", self.maxHeight || \"none\");\n\n }\n\n // If the `size` option is not a number\n else {\n\n // Returns the x and y coordinates of the dropdown list options list relative to the document\n var listOffsetTop = self.dropdown.offset().top,\n\n // The height of the dropdown list options list\n listHeight = self.list.data(\"max-height\") || self.list.outerHeight(),\n\n // The height of the dropdown list DOM element\n selectBoxHeight = self.dropdown.outerHeight(),\n\n viewport = self.options[\"viewport\"],\n\n viewportHeight = viewport.height(),\n\n viewportScrollTop = $.isWindow(viewport.get(0)) ? viewport.scrollTop() : viewport.offset().top,\n\n topToBottom = (listOffsetTop + selectBoxHeight + listHeight <= viewportHeight + viewportScrollTop),\n\n bottomReached = !topToBottom;\n\n if(!self.list.data(\"max-height\")) {\n\n self.list.data(\"max-height\", self.list.outerHeight());\n\n }\n\n // If there is room on the bottom of the viewport to display the drop down options\n if (!bottomReached) {\n\n self.list.css(\"max-height\", listHeight);\n\n // Sets custom CSS properties to place the dropdown list options directly below the dropdown list\n self.list.css(\"top\", \"auto\");\n\n self.dropdown.addClass(openDownClassName);\n\n }\n\n // If there is room on the top of the viewport\n else if((self.dropdown.offset().top - viewportScrollTop) >= listHeight) {\n\n self.list.css(\"max-height\", listHeight);\n\n // Sets custom CSS properties to place the dropdown list options directly above the dropdown list\n self.list.css(\"top\", (self.dropdown.position().top - self.list.outerHeight()));\n\n self.dropdown.addClass(openUpClassName);\n\n }\n\n // If there is not enough room on the top or the bottom\n else {\n\n var outsideBottomViewport = Math.abs((listOffsetTop + selectBoxHeight + listHeight) - (viewportHeight + viewportScrollTop)),\n\n outsideTopViewport = Math.abs((self.dropdown.offset().top - viewportScrollTop) - listHeight);\n\n // If there is more room on the bottom\n if(outsideBottomViewport < outsideTopViewport) {\n\n self.list.css(\"max-height\", listHeight - outsideBottomViewport - (selectBoxHeight/2));\n\n self.list.css(\"top\", \"auto\");\n\n self.dropdown.addClass(openDownClassName);\n }\n\n // If there is more room on the top\n else {\n\n self.list.css(\"max-height\", listHeight - outsideTopViewport - (selectBoxHeight/2));\n\n // Sets custom CSS properties to place the dropdown list options directly above the dropdown list\n self.list.css(\"top\", (self.dropdown.position().top - self.list.outerHeight()));\n\n self.dropdown.addClass(openUpClassName);\n }\n\n }\n\n }\n\n // Maintains chainability\n return self;\n\n };\n // Enable Module\n // =============\n\n // Enable\n // ------\n // Enables the new dropdown list\n\n selectBoxIt.enable = function(callback) {\n\n var self = this;\n\n if(self.options[\"disabled\"]) {\n\n // Triggers a `enable` custom event on the original select box\n self.triggerEvent(\"enable\");\n\n // Removes the `disabled` attribute from the original dropdown list\n self.selectBox.removeAttr(\"disabled\");\n\n // Make the dropdown list focusable\n self.dropdown.attr(\"tabindex\", 0).\n\n // Disable styling for disabled state\n removeClass(self.theme[\"disabled\"]).\n\n // Enables styling for enabled state\n addClass(self.theme[\"enabled\"]);\n\n self._setOption(\"disabled\", false);\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n }\n\n // Maintains chainability\n return self;\n\n };\n\n // Enable Option\n // -------------\n // Disables a single drop down option\n\n selectBoxIt.enableOption = function(index, callback) {\n\n var self = this, currentSelectBoxOption, currentIndex = 0, hasNextEnabled, hasPreviousEnabled, type = $.type(index);\n\n // If an index is passed to target an indropdownidual drop down option\n if(type === \"number\") {\n\n // The select box option being targeted\n currentSelectBoxOption = self.selectBox.find(\"option\").eq(index);\n\n // Triggers a `enable-option` custom event on the original select box and passes the enabled option\n self.triggerEvent(\"enable-option\");\n\n // Disables the targeted select box option\n currentSelectBoxOption.removeAttr(\"disabled\");\n\n // Disables the drop down option\n self.listItems.eq(index).attr(\"data-disabled\", \"false\").\n\n // Applies disabled styling for the drop down option\n removeClass(self.theme[\"disabled\"]);\n\n }\n\n // Provides callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n // Keyboard Navigation Module\n // ==========================\n\n // Move Down\n // ---------\n // Handles the down keyboard navigation logic\n\n selectBoxIt.moveDown = function(callback) {\n\n var self = this;\n\n // Increments `currentFocus`, which represents the currently focused list item `id` attribute.\n self.currentFocus += 1;\n\n // Determines whether the dropdown option the user is trying to go to is currently disabled\n var disabled = self.listItems.eq(self.currentFocus).attr(\"data-disabled\") === \"true\" ? true: false,\n\n hasNextEnabled = self.listItems.eq(self.currentFocus).nextAll(\"li\").not(\"[data-disabled='true']\").first().length;\n\n // If the user has reached the top of the list\n if (self.currentFocus === self.listItems.length) {\n\n // Does not allow the user to continue to go up the list\n self.currentFocus -= 1;\n\n }\n\n // If the option the user is trying to go to is disabled, but there is another enabled option\n else if (disabled && hasNextEnabled) {\n\n // Blur the previously selected option\n self.listItems.eq(self.currentFocus - 1).blur();\n\n // Call the `moveDown` method again\n self.moveDown();\n\n // Exit the method\n return;\n\n }\n\n // If the option the user is trying to go to is disabled, but there is not another enabled option\n else if (disabled && !hasNextEnabled) {\n\n self.currentFocus -= 1;\n\n }\n\n // If the user has not reached the bottom of the unordered list\n else {\n\n // Blurs the previously focused list item\n // The jQuery `end()` method allows you to continue chaining while also using a different selector\n self.listItems.eq(self.currentFocus - 1).blur().end().\n\n // Focuses the currently focused list item\n eq(self.currentFocus).focusin();\n\n // Calls `scrollToView` to make sure the `scrollTop` is correctly updated. The `down` user action\n self._scrollToView(\"down\");\n\n // Triggers the custom `moveDown` event on the original select box\n self.triggerEvent(\"moveDown\");\n\n }\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n\n // Move Up\n // ------\n // Handles the up keyboard navigation logic\n selectBoxIt.moveUp = function(callback) {\n\n var self = this;\n\n // Increments `currentFocus`, which represents the currently focused list item `id` attribute.\n self.currentFocus -= 1;\n\n // Determines whether the dropdown option the user is trying to go to is currently disabled\n var disabled = self.listItems.eq(self.currentFocus).attr(\"data-disabled\") === \"true\" ? true: false,\n\n hasPreviousEnabled = self.listItems.eq(self.currentFocus).prevAll(\"li\").not(\"[data-disabled='true']\").first().length;\n\n // If the user has reached the top of the list\n if (self.currentFocus === -1) {\n\n // Does not allow the user to continue to go up the list\n self.currentFocus += 1;\n\n }\n\n // If the option the user is trying to go to is disabled and the user is not trying to go up after the user has reached the top of the list\n else if (disabled && hasPreviousEnabled) {\n\n // Blur the previously selected option\n self.listItems.eq(self.currentFocus + 1).blur();\n\n // Call the `moveUp` method again\n self.moveUp();\n\n // Exits the method\n return;\n\n }\n\n else if (disabled && !hasPreviousEnabled) {\n\n self.currentFocus += 1;\n\n }\n\n // If the user has not reached the top of the unordered list\n else {\n\n // Blurs the previously focused list item\n // The jQuery `end()` method allows you to continue chaining while also using a different selector\n self.listItems.eq(this.currentFocus + 1).blur().end().\n\n // Focuses the currently focused list item\n eq(self.currentFocus).focusin();\n\n // Calls `scrollToView` to make sure the `scrollTop` is correctly updated. The `down` user action\n self._scrollToView(\"up\");\n\n // Triggers the custom `moveDown` event on the original select box\n self.triggerEvent(\"moveUp\");\n\n }\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n // Keyboard Search Module\n // ======================\n\n // _Set Current Search Option\n // -------------------------\n // Sets the currently selected dropdown list search option\n\n selectBoxIt._setCurrentSearchOption = function(currentOption) {\n\n var self = this;\n\n // Does not change the current option if `showFirstOption` is false and the matched search item is the hidden first option.\n // Otherwise, the current option value is updated\n if ((self.options[\"aggressiveChange\"] || self.options[\"selectWhenHidden\"] || self.listItems.eq(currentOption).is(\":visible\")) && self.listItems.eq(currentOption).data(\"disabled\") !== true) {\n\n // Calls the `blur` event of the currently selected dropdown list option\n self.listItems.eq(self.currentFocus).blur();\n\n // Sets `currentIndex` to the currently selected dropdown list option\n self.currentIndex = currentOption;\n\n // Sets `currentFocus` to the currently selected dropdown list option\n self.currentFocus = currentOption;\n\n // Focuses the currently selected dropdown list option\n self.listItems.eq(self.currentFocus).focusin();\n\n // Updates the scrollTop so that the currently selected dropdown list option is visible to the user\n self._scrollToView(\"search\");\n\n // Triggers the custom `search` event on the original select box\n self.triggerEvent(\"search\");\n\n }\n\n // Maintains chainability\n return self;\n\n };\n\n // _Search Algorithm\n // -----------------\n // Uses regular expressions to find text matches\n selectBoxIt._searchAlgorithm = function(currentIndex, alphaNumeric) {\n\n var self = this,\n\n options = self.options,\n\n // Boolean to determine if a pattern match exists\n matchExists = false,\n\n // Iteration variable used in the outermost for loop\n x,\n\n // Iteration variable used in the nested for loop\n y,\n\n // Variable used to cache the length of the text array (Small enhancement to speed up traversing)\n arrayLength,\n\n // Variable storing the current search\n currentSearch,\n\n // Variable storing the textArray property\n textArray = self.textArray,\n\n // Variable storing the current text property\n currentText = self.currentText,\n\n // Option for how many characters a user must search to be treated as a full string search\n numSearchCharacters = $.type(options.numSearchCharacters) === 'number' ? options.numSearchCharacters : 3;\n\n // Loops through the text array to find a pattern match\n for (x = currentIndex, arrayLength = textArray.length; x < arrayLength; x += 1) {\n\n currentSearch = textArray[x];\n\n // Nested for loop to help search for a pattern match with the currently traversed array item\n for (y = 0; y < arrayLength; y += 1) {\n\n // Searches for a match\n if (textArray[y].search(alphaNumeric) !== -1) {\n\n // `matchExists` is set to true if there is a match\n matchExists = true;\n\n // Exits the nested for loop\n y = arrayLength;\n\n }\n\n } // End nested for loop\n\n // If a match does not exist\n if (!matchExists) {\n\n // Sets the current text to the last entered character\n self.currentText = self.currentText.charAt(self.currentText.length - 1).\n\n // Escapes the regular expression to make sure special characters are seen as literal characters instead of special commands\n replace(/[|()\\[{.+*?$\\\\]/g, \"\\\\$0\");\n\n currentText = self.currentText;\n\n }\n\n // Resets the regular expression with the new value of `self.currentText`\n alphaNumeric = new RegExp(currentText, \"gi\");\n\n // Searches based on the first letter of the dropdown list options text if the currentText < 3 characters\n if (currentText.length < numSearchCharacters) {\n\n alphaNumeric = new RegExp(currentText.charAt(0), \"gi\");\n\n // If there is a match based on the first character\n if ((currentSearch.charAt(0).search(alphaNumeric) !== -1)) {\n\n // Sets properties of that dropdown list option to make it the currently selected option\n self._setCurrentSearchOption(x);\n\n if((currentSearch.substring(0, currentText.length).toLowerCase() !== currentText.toLowerCase()) || self.options[\"similarSearch\"]) {\n\n // Increments the current index by one\n self.currentIndex += 1;\n\n }\n\n // Exits the search\n return false;\n\n }\n\n }\n\n // If `self.currentText` > 1 character\n else {\n\n // If there is a match based on the entire string\n if ((currentSearch.search(alphaNumeric) !== -1)) {\n\n // Sets properties of that dropdown list option to make it the currently selected option\n self._setCurrentSearchOption(x);\n\n // Exits the search\n return false;\n\n }\n\n }\n\n // If the current text search is an exact match\n if (currentSearch.toLowerCase() === self.currentText.toLowerCase()) {\n\n // Sets properties of that dropdown list option to make it the currently selected option\n self._setCurrentSearchOption(x);\n\n // Resets the current text search to a blank string to start fresh again\n self.currentText = \"\";\n\n // Exits the search\n return false;\n\n }\n\n }\n\n // Returns true if there is not a match at all\n return true;\n\n };\n\n // Search\n // ------\n // Calls searchAlgorithm()\n selectBoxIt.search = function(alphaNumericKey, callback, rememberPreviousSearch) {\n\n var self = this;\n\n // If the search method is being called internally by the plugin, and not externally as a method by a user\n if (rememberPreviousSearch) {\n\n // Continued search with history from past searches. Properly escapes the regular expression\n self.currentText += alphaNumericKey.replace(/[|()\\[{.+*?$\\\\]/g, \"\\\\$0\");\n\n }\n\n else {\n\n // Brand new search. Properly escapes the regular expression\n self.currentText = alphaNumericKey.replace(/[|()\\[{.+*?$\\\\]/g, \"\\\\$0\");\n\n }\n\n // Searches globally\n var searchResults = self._searchAlgorithm(self.currentIndex, new RegExp(self.currentText, \"gi\"));\n\n // Searches the list again if a match is not found. This is needed, because the first search started at the array indece of the currently selected dropdown list option, and does not search the options before the current array indece.\n // If there are many similar dropdown list options, starting the search at the indece of the currently selected dropdown list option is needed to properly traverse the text array.\n if (searchResults) {\n\n // Searches the dropdown list values starting from the beginning of the text array\n self._searchAlgorithm(0, self.currentText);\n\n }\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n // Mobile Module\n // =============\n\n // Set Mobile Text\n // ---------------\n // Updates the text of the drop down\n selectBoxIt._updateMobileText = function() {\n\n var self = this,\n currentOption,\n currentDataText,\n currentText;\n\n currentOption = self.selectBox.find(\"option\").filter(\":selected\");\n\n currentDataText = currentOption.attr(\"data-text\");\n\n currentText = currentDataText ? currentDataText: currentOption.text();\n\n // Sets the new dropdown list text to the value of the original dropdown list\n self._setText(self.dropdownText, currentText);\n\n if(self.list.find('li[data-val=\"' + currentOption.val() + '\"]').find(\"i\").attr(\"class\")) {\n\n self.dropdownImage.attr(\"class\", self.list.find('li[data-val=\"' + currentOption.val() + '\"]').find(\"i\").attr(\"class\")).addClass(\"selectboxit-default-icon\");\n\n }\n\n };\n\n // Apply Native Select\n // -------------------\n // Applies the original select box directly over the new drop down\n\n selectBoxIt._applyNativeSelect = function() {\n\n // Stores the plugin context inside of the self variable\n var self = this;\n\n // Appends the native select box to the drop down (allows for relative positioning using the position() method)\n self.dropdownContainer.append(self.selectBox);\n\n self.dropdown.attr(\"tabindex\", \"-1\");\n\n // Positions the original select box directly over top the new dropdown list using position absolute and \"hides\" the original select box using an opacity of 0. This allows the mobile browser \"wheel\" interface for better usability.\n self.selectBox.css({\n\n \"display\": \"block\",\n\n \"visibility\": \"visible\",\n\n \"width\": self._realOuterWidth(self.dropdown),\n\n \"height\": self.dropdown.outerHeight(),\n\n \"opacity\": \"0\",\n\n \"position\": \"absolute\",\n\n \"top\": \"0\",\n\n \"left\": \"0\",\n\n \"cursor\": \"pointer\",\n\n \"z-index\": \"999999\",\n\n \"margin\": self.dropdown.css(\"margin\"),\n\n \"padding\": \"0\",\n\n \"-webkit-appearance\": \"menulist-button\"\n\n });\n\n if(self.originalElem.disabled) {\n\n self.triggerEvent(\"disable\");\n\n }\n\n return this;\n\n };\n\n // Mobile Events\n // -------------\n // Listens to mobile-specific events\n selectBoxIt._mobileEvents = function() {\n\n var self = this;\n\n self.selectBox.on({\n\n \"changed.selectBoxIt\": function() {\n\n self.hasChanged = true;\n\n self._updateMobileText();\n\n // Triggers the `option-click` event on mobile\n self.triggerEvent(\"option-click\");\n\n },\n\n \"mousedown.selectBoxIt\": function() {\n\n // If the select box has not been changed, the defaultText option is being used\n if(!self.hasChanged && self.options.defaultText && !self.originalElem.disabled) {\n\n self._updateMobileText();\n\n self.triggerEvent(\"option-click\");\n\n }\n\n },\n\n \"enable.selectBoxIt\": function() {\n\n // Moves SelectBoxIt onto the page\n self.selectBox.removeClass('selectboxit-rendering');\n\n },\n\n \"disable.selectBoxIt\": function() {\n\n // Moves SelectBoxIt off the page\n self.selectBox.addClass('selectboxit-rendering');\n\n },\n\n \"destroy.selectBoxIt\": function() {\n\n // Reset SelectBoxIt class\n self.selectBox.removeClass('selectboxit-rendering');\n\n }\n });\n\n };\n\n // Mobile\n // ------\n // Applies the native \"wheel\" interface when a mobile user is interacting with the dropdown\n\n selectBoxIt._mobile = function(callback) {\n\n // Stores the plugin context inside of the self variable\n var self = this;\n\n if(self.isMobile) {\n\n self._applyNativeSelect();\n\n self._mobileEvents();\n\n }\n\n // Maintains chainability\n return this;\n\n };\n // Select Option Module\n // ====================\n\n // Select Option\n // -------------\n // Programatically selects a drop down option by either index or value\n\n selectBoxIt.selectOption = function(val, callback) {\n\n // Stores the plugin context inside of the self variable\n var self = this,\n type = $.type(val);\n\n // Makes sure the passed in position is a number\n if(type === \"number\") {\n\n // Set's the original select box value and triggers the change event (which SelectBoxIt listens for)\n self.selectBox.val(self.selectItems.eq(val).val()).change();\n\n }\n\n else if(type === \"string\") {\n\n // Set's the original select box value and triggers the change event (which SelectBoxIt listens for)\n self.selectBox.val(val).change();\n\n }\n\n // Calls the callback function\n self._callbackSupport(callback);\n\n // Maintains chainability\n return self;\n\n };\n // Set Option Module\n // =================\n\n // Set Option\n // ----------\n // Accepts an string key, a value, and a callback function to replace a single\n // property of the plugin options object\n\n selectBoxIt.setOption = function(key, value, callback) {\n\n var self = this;\n\n //Makes sure a string is passed in\n if($.type(key) === \"string\") {\n\n // Sets the plugin option to the new value provided by the user\n self.options[key] = value;\n\n }\n\n // Rebuilds the dropdown\n self.refresh(function() {\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n }, true);\n\n // Maintains chainability\n return self;\n\n };\n // Set Options Module\n // ==================\n\n // Set Options\n // ----------\n // Accepts an object to replace plugin options\n // properties of the plugin options object\n\n selectBoxIt.setOptions = function(newOptions, callback) {\n\n var self = this;\n\n // If the passed in parameter is an object literal\n if($.isPlainObject(newOptions)) {\n\n self.options = $.extend({}, self.options, newOptions);\n\n }\n\n // Rebuilds the dropdown\n self.refresh(function() {\n\n // Provide callback function support\n self._callbackSupport(callback);\n\n }, true);\n\n // Maintains chainability\n return self;\n\n };\n // Wait Module\n // ===========\n\n // Wait\n // ----\n // Delays execution by the amount of time\n // specified by the parameter\n\n selectBoxIt.wait = function(time, callback) {\n\n var self = this;\n\n self.widgetProto._delay.call(self, callback, time);\n\n // Maintains chainability\n return self;\n\n };\n // Add Options Module\n // ==================\n\n // add\n // ---\n // Adds drop down options\n // using JSON data, an array,\n // a single object, or valid HTML string\n\n selectBoxIt.add = function(data, callback) {\n\n this._populate(data, function(data) {\n\n var self = this,\n dataType = $.type(data),\n value,\n x = 0,\n dataLength,\n elems = [],\n isJSON = self._isJSON(data),\n parsedJSON = isJSON && self._parseJSON(data);\n\n // If the passed data is a local or JSON array\n if(data && (dataType === \"array\" || (isJSON && parsedJSON.data && $.type(parsedJSON.data) === \"array\")) || (dataType === \"object\" && data.data && $.type(data.data) === \"array\")) {\n\n // If the data is JSON\n if(self._isJSON(data)) {\n\n // Parses the JSON and stores it in the data local variable\n data = parsedJSON;\n\n }\n\n // If there is an inner `data` property stored in the first level of the JSON array\n if(data.data) {\n\n // Set's the data to the inner `data` property\n data = data.data;\n\n }\n\n // Loops through the array\n for(dataLength = data.length; x <= dataLength - 1; x += 1) {\n\n // Stores the currently traversed array item in the local `value` variable\n value = data[x];\n\n // If the currently traversed array item is an object literal\n if($.isPlainObject(value)) {\n\n // Adds an option to the elems array\n elems.push($(\"