draggable - ui-draggable and ui-draggable-disabled classes were not being added

This commit is contained in:
Richard Worth 2008-05-26 20:30:27 +00:00
parent 661f111abb
commit c28d263667

View File

@ -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();
} }
})); }));