]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: revert option now accepts "invalid", "valid" and true as possible options...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 3 Jul 2008 14:59:10 +0000 (14:59 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 3 Jul 2008 14:59:10 +0000 (14:59 +0000)
ui/ui.draggable.js

index 6dd939b1f5d9e12b2f875adcb9aed3219a18784f..69f92b0d7e9123dbdadfe4ac5309a3b88b869bae 100644 (file)
@@ -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);