Skip to content
Permalink
Browse files

draggable: revert option now accepts "invalid", "valid" and true as p…

…ossible options: true always reverts, "invalid" only reverts when not dropped on a possible target, and "valid" does the contrary (implements #2914)
  • Loading branch information
Paul Bakaus
Paul Bakaus committed Jul 3, 2008
1 parent 069fcab commit 7c5e5d9c5e1e7cb90b33fd9e7faca6b721b633af
Showing with 4 additions and 3 deletions.
  1. +4 −3 ui/ui.draggable.js
@@ -216,10 +216,11 @@ $.widget("ui.draggable", $.extend($.ui.mouse, {
mouseStop: function(e) {

//If we are using droppables, inform the manager about the drop
var dropped = false;
if ($.ui.ddmanager && !this.options.dropBehaviour)
$.ui.ddmanager.drop(this, e);
if(this.options.revert) {
var dropped = $.ui.ddmanager.drop(this, e);

if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true) {
var self = this;
$(this.helper).animate(this.originalPosition, parseInt(this.options.revert, 10) || 500, function() {
self.propagate("stop", e);

0 comments on commit 7c5e5d9

Please sign in to comment.
You can’t perform that action at this time.