Draggable: Added revertDuration backCompat.

This commit is contained in:
Dave Stein 2012-12-11 19:28:47 -05:00
parent 5a2e5a0a9a
commit 34b4fbf08b

View File

@ -709,10 +709,11 @@ if ( $.uiBackCompat !== false ) {
}); });
// TODO: handle droppables // TODO: handle droppables
// revert option // revert + revertDuration options
$.widget( "ui.draggable", $.ui.draggable, { $.widget( "ui.draggable", $.ui.draggable, {
options: { options: {
revert: false revert: false,
revertDuration: 500
}, },
_create : function() { _create : function() {
@ -739,11 +740,11 @@ if ( $.uiBackCompat !== false ) {
this.element.on( "dragstop", function( e, ui ) { this.element.on( "dragstop", function( e, ui ) {
// Reset to before drag // Reset to before drag
self.dragEl.css({ self.dragEl.animate({
left: originalLeft, left: originalLeft,
top: originalTop, top: originalTop,
position: originalPosition position: originalPosition
}); }, self.options.revertDuration );
}); });