Skip to content
Permalink
Browse files

slider: check in the destroy method if a handle actually exists or no…

…t, before calling removal functions (fixes #2987)
  • Loading branch information
Paul Bakaus
Paul Bakaus committed Jun 19, 2008
1 parent 430a0da commit 34bb6717b30d66f6e9e75a7181b9b86f76a35874
Showing with 11 additions and 5 deletions.
  1. +11 −5 ui/ui.slider.js
@@ -36,16 +36,22 @@ $.widget("ui.slider", {
this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
},
destroy: function() {

this.element
.removeClass("ui-slider ui-slider-disabled")
.removeData("slider")
.unbind(".slider");
this.handle
.unwrap("a");
this.handle.each(function() {
$(this).data("mouse").mouseDestroy();
});

if(this.handle && this.handle.length) {
this.handle
.unwrap("a");
this.handle.each(function() {
$(this).data("mouse").mouseDestroy();
});
}

this.generated && this.generated.remove();

},
setData: function(key, value) {
$.widget.prototype.setData.apply(this, arguments);

0 comments on commit 34bb671

Please sign in to comment.
You can’t perform that action at this time.