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]);
|
this.element.triggerHandler(n == "slide" ? n : "slide"+n, [e, this.ui()], this.options[n]);
|
||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
|
||||||
this.element
|
this.element
|
||||||
.removeClass("ui-slider ui-slider-disabled")
|
.removeClass("ui-slider ui-slider-disabled")
|
||||||
.removeData("slider")
|
.removeData("slider")
|
||||||
.unbind(".slider");
|
.unbind(".slider");
|
||||||
|
|
||||||
|
if(this.handle && this.handle.length) {
|
||||||
this.handle
|
this.handle
|
||||||
.unwrap("a");
|
.unwrap("a");
|
||||||
this.handle.each(function() {
|
this.handle.each(function() {
|
||||||
$(this).data("mouse").mouseDestroy();
|
$(this).data("mouse").mouseDestroy();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.generated && this.generated.remove();
|
this.generated && this.generated.remove();
|
||||||
|
|
||||||
},
|
},
|
||||||
setData: function(key, value) {
|
setData: function(key, value) {
|
||||||
$.widget.prototype.setData.apply(this, arguments);
|
$.widget.prototype.setData.apply(this, arguments);
|
||||||
|
Loading…
Reference in New Issue
Block a user