mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Draggable: Added revertDuration backCompat.
This commit is contained in:
parent
5a2e5a0a9a
commit
34b4fbf08b
9
ui/jquery.ui.draggable.js
vendored
9
ui/jquery.ui.draggable.js
vendored
@ -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 );
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user