/*! * Copyright Ben Olson (https://github.com/bseth99/jquery-ui-extensions) * jQuery UI ComboBox @VERSION * * Adapted from Jörn Zaefferer original implementation at * http://www.learningjquery.com/2010/06/a-jquery-ui-combobox-under-the-hood * * And the demo at * http://jqueryui.com/autocomplete/#combobox * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * */ (function( $, undefined ) { $.widget( "ui.combobox", { version: "@VERSION", widgetEventPrefix: "combobox", uiCombo: null, uiInput: null, _wasOpen: false, _create: function() { var self = this, select = this.element.hide(), input, wrapper; input = this.uiInput = $( "" ) .insertAfter(select) .addClass("ui-widget ui-widget-content ui-corner-left ui-combobox-input") .val( select.children(':selected').text() ) .attr('tabindex', select.attr( 'tabindex')) .width($(this.element).width()); wrapper = this.uiCombo = input.wrap( '' ) .parent() .addClass( 'ui-combobox' ) .insertAfter( select ); input .autocomplete({ delay: 0, minLength: 0, appendTo: wrapper, source: $.proxy( this, "_linkSelectList" ), select: function(event, ui) { //var selectedObj = ui.item; $(this).attr('title', ui.item.value); } }); $( "