Draggable: Add ui-draggable class.

This commit is contained in:
Scott González 2011-10-27 14:20:55 -04:00
parent 1337573adc
commit e1e43e3109

View File

@ -41,6 +41,7 @@ $.widget( "ui.draggable", {
this.element.css( "position", "relative" ); this.element.css( "position", "relative" );
} }
this.element.addClass( "ui-draggable" );
this._bind({ mousedown: "_mouseDown" }); this._bind({ mousedown: "_mouseDown" });
}, },
@ -56,7 +57,7 @@ $.widget( "ui.draggable", {
// Take into account scrollbar // Take into account scrollbar
position.top -= scrollTop; position.top -= scrollTop;
position.left -= scrollLeft position.left -= scrollLeft;
return position; return position;
} }
@ -258,7 +259,7 @@ $.widget( "ui.draggable", {
this.tempPosition = { this.tempPosition = {
left: newLeft, left: newLeft,
top: newTop top: newTop
} };
// Refresh offset cache with new positions // Refresh offset cache with new positions
this.offset.left = this.startOffset.left + newLeft; this.offset.left = this.startOffset.left + newLeft;
@ -297,6 +298,10 @@ $.widget( "ui.draggable", {
position: this.position, position: this.position,
offset: this.offset offset: this.offset
}; };
},
_destroy: function() {
this.element.removeClass( "ui-draggable" );
} }
}); });