mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
slider: check in the destroy method if a handle actually exists or not, before calling removal functions (fixes #2987)
This commit is contained in:
parent
430a0da9f6
commit
34bb6717b3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user