From d97add11b08227b3cbde76c2e93fe50c42a27123 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 23 Nov 2010 08:22:40 -0500 Subject: [PATCH] Combobox: Added a destroy method. Fixes #6685 - Combobox: Doesn't handle destroy. --- demos/autocomplete/combobox.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index c1407385a..ab939a036 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -24,7 +24,7 @@ select = this.element.hide(), selected = select.children( ":selected" ), value = selected.val() ? selected.text() : ""; - var input = $( "" ) + var input = this.input = $( "" ) .insertAfter( select ) .val( value ) .autocomplete({ @@ -81,7 +81,7 @@ .appendTo( ul ); }; - $( "" ) + this.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 ); -- 2.39.5