Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give drag.revert an optional callback to notify when revert is complete. #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion event/drag/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ steal('jquery/event', 'jquery/lang/vector', 'jquery/event/livehack',function( $
top: this.startPosition.top() + "px",
left: this.startPosition.left() + "px"
}, function() {
if ( typeof self._revert == "function" ) {
self._revert();
}
self.cleanup.apply(self, arguments);
});
}
Expand Down Expand Up @@ -482,7 +485,7 @@ steal('jquery/event', 'jquery/lang/vector', 'jquery/event/livehack',function( $
* drag.revert()
* }
* @codeend
* @param {Boolean} [val] optional, set to false if you don't want to revert.
* @param {Boolean} [val] optional, set to false if you don't want to revert, or a callback function which occurs when revertion is complete.
*/
revert: function( val ) {
this._revert = val === undefined ? true : val;
Expand Down