Skip to content

Commit

Permalink
Combobox: Added a destroy method. Fixes #6685 - Combobox: Doesn't han…
Browse files Browse the repository at this point in the history
…dle destroy.
  • Loading branch information
scottgonzalez committed Nov 23, 2010
1 parent 9ade710 commit d97add1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions demos/autocomplete/combobox.html
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -81,7 +81,7 @@
.appendTo( ul );
};

$( "<button>&nbsp;</button>" )
this.button = $( "<button>&nbsp;</button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.insertAfter( input )
Expand All @@ -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 );
Expand Down

0 comments on commit d97add1

Please sign in to comment.