aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-11-23 08:22:40 -0500
committerScott González <scott.gonzalez@gmail.com>2010-11-23 08:22:40 -0500
commitd97add11b08227b3cbde76c2e93fe50c42a27123 (patch)
tree989afa248214913a43248f7356aa0799d5d17677 /demos
parent9ade71071a54fba328a429e608757e8d984b052e (diff)
downloadjquery-ui-d97add11b08227b3cbde76c2e93fe50c42a27123.tar.gz
jquery-ui-d97add11b08227b3cbde76c2e93fe50c42a27123.zip
Combobox: Added a destroy method. Fixes #6685 - Combobox: Doesn't handle destroy.
Diffstat (limited to 'demos')
-rw-r--r--demos/autocomplete/combobox.html11
1 files 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 = $( "<input>" )
+ var input = this.input = $( "<input>" )
.insertAfter( select )
.val( value )
.autocomplete({
@@ -81,7 +81,7 @@
.appendTo( ul );
};
- $( "<button>&nbsp;</button>" )
+ this.button = $( "<button>&nbsp;</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 );