/* * jQuery Combobox Plugin 1.1.2 * Copyright 2011 Eugene Poltorakov (http://poltorakov.com) * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php * * There are several event which triggered from this plugin on select element. * - update_position - Trigger before update position of dropdown. * It gets calculated offset object as second argument which could be changed to affect position of dropdown; * - before_show - trigger before show dropdown; * - before_hide - trigger before hide dropdown; * - combo_init - trigger after init; * * * todo: * - somehow handle mobile devices * - add adjustWidth & basic theme support overview in readme * - make multiselect widget using checkboxes * - remake tab action * - use event namespace * - mobile version ? */ (function($, undefined ) { var Combobox = function(element, options) { var self = this, $element = $(element), _hover_inited = false; if (element.combobox != undefined) { return false; } element.combobox = self; self.options = options; self.element = element; self.$element = $element; self.multiple = element.multiple; //create new elements and make link to the object on it (self._list = (self.list = $('