mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
draggable - ui-draggable and ui-draggable-disabled classes were not being added
This commit is contained in:
parent
661f111abb
commit
c28d263667
@ -22,12 +22,19 @@
|
|||||||
var o = this.options;
|
var o = this.options;
|
||||||
|
|
||||||
//Position the node
|
//Position the node
|
||||||
if(o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
|
if (o.helper == 'original' && !(/(relative|absolute|fixed)/).test(this.element.css('position')))
|
||||||
this.element.css('position', 'relative');
|
this.element.css('position', 'relative');
|
||||||
|
|
||||||
|
this.element.addClass('ui-draggable');
|
||||||
|
(o.disabled && this.element.addClass('ui-draggable-disabled'));
|
||||||
|
|
||||||
this.mouseInit();
|
this.mouseInit();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
setData: function(key, value) {
|
||||||
|
(key == 'disabled' && this.element[(value ? 'add' : 'remove') + 'Class']('ui-draggable-disabled'));
|
||||||
|
this.options[key] = value;
|
||||||
|
},
|
||||||
mouseStart: function(e) {
|
mouseStart: function(e) {
|
||||||
var o = this.options;
|
var o = this.options;
|
||||||
|
|
||||||
@ -247,7 +254,7 @@
|
|||||||
},
|
},
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
if(!this.element.data('draggable')) return;
|
if(!this.element.data('draggable')) return;
|
||||||
this.element.removeData("draggable").unbind(".draggable");
|
this.element.removeData("draggable").unbind(".draggable").removeClass('ui-draggable');
|
||||||
this.mouseDestroy();
|
this.mouseDestroy();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user