Skip to content
Permalink
Browse files

droppable: $.ui.ddmanager.drop now returns false in case of non-drop,…

… or the actual droppable (instead of true) in the case of a drop.

draggable: implemented patch that allows revert to be a callback, receives one argument which is the droppable (implements #3175)
  • Loading branch information...
Paul Bakaus
Paul Bakaus committed Sep 18, 2008
1 parent c40491f commit 9c0942d14f25909bf8e3b8064965323c280f4274
Showing with 2 additions and 2 deletions.
  1. +1 −1 ui/ui.draggable.js
  2. +1 −1 ui/ui.droppable.js
@@ -309,7 +309,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
if ($.ui.ddmanager && !this.options.dropBehaviour)
var dropped = $.ui.ddmanager.drop(this, e);

if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true) {
if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
var self = this;
$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10) || 500, function() {
self._propagate("stop", e);
@@ -107,7 +107,7 @@ $.widget("ui.droppable", {
if(this.options.accept.call(this.element,(draggable.currentItem || draggable.element))) {
$.ui.plugin.call(this, 'drop', [e, this.ui(draggable)]);
this.element.triggerHandler("drop", [e, this.ui(draggable)], this.options.drop);
return true;
return this.element;
}

return false;

0 comments on commit 9c0942d

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