mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Combobox: Added a destroy method. Fixes #6685 - Combobox: Doesn't handle destroy.
This commit is contained in:
parent
9ade71071a
commit
d97add11b0
@ -24,7 +24,7 @@
|
||||
select = this.element.hide(),
|
||||
selected = select.children( ":selected" ),
|
||||
value = selected.val() ? selected.text() : "";
|
||||
var input = $( "<input>" )
|
||||
var input = this.input = $( "<input>" )
|
||||
.insertAfter( select )
|
||||
.val( value )
|
||||
.autocomplete({
|
||||
@ -81,7 +81,7 @@
|
||||
.appendTo( ul );
|
||||
};
|
||||
|
||||
$( "<button> </button>" )
|
||||
this.button = $( "<button> </button>" )
|
||||
.attr( "tabIndex", -1 )
|
||||
.attr( "title", "Show All Items" )
|
||||
.insertAfter( input )
|
||||
@ -104,6 +104,13 @@
|
||||
input.autocomplete( "search", "" );
|
||||
input.focus();
|
||||
});
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.input.remove();
|
||||
this.button.remove();
|
||||
this.element.show();
|
||||
$.Widget.prototype.destroy.call( this );
|
||||
}
|
||||
});
|
||||
})( jQuery );
|
||||
|
Loading…
Reference in New Issue
Block a user