/** * jQuery Editable Select * Indri Muska * * Source on GitHub @ https://github.com/indrimuska/jquery-editable-select */ +(function($) { // jQuery Editable Select EditableSelect = function(select, options) { var that = this; if(select.nodeName == "SELECT") { var inputProperties = { type: "text", autocomplete: "off" }; //Add the user input properties to the ones specified above. if(options.inputProperties && options.inputProperties instanceof Object) $.extend(inputProperties, options.inputProperties); this.$select = $(select); this.$input = $('', inputProperties); //Replace the select with an input widget in the view. this.$select.replaceWith(this.$input); } else if(select.nodeName == "INPUT") { this.$select = undefined; this.$input = $(select); } //Save the options. this.options = options; //Add the list to the input's parent or the appendTo in the options. this.$list = $('