jQuery ui.draggable event/status on revert -
What is a way to get information if the dragable element has been returned?
I'm stuck on this I want to make an element eligible to drop again, but only if there is a lie that goes away somewhere else (which does not make sense).
It seems that it is not supported for the jQuery UI so you can add it like this: < / P>
$ Ui.draggable.prototype._mouseStop = function event) {// If we are using droppables, inform the manager about drop down var = false; If ($ .ui.ddmanager & amp;! This.options.dropBehaviour) = $ .ui.ddmanager.drop dropped (this, incident); // If a drop comes from outside (a sorted) if (this.dropped) {dropped = this.dropped; This.dropped = false; } If ((this.options.revert == "invalid" & dropped) || (this.options.revert == "valid" and left & amp; amp; amp; amp; amp; amp; amp; amp; This.options.revert === True || ($ .isfunction (this.options.revert) & amp; amp; this.options.revert.call (this.ment, dropped)) {var self = This; Self._trigger ("back", incident); $ (This.helper) .animate (this.originalPosition, parseInt (this.options.revertDuration, 10), function () {event.reverted = true; self._trigger ("stop", event); self._clear () ;}); } And {this._trigger ("stop", event); This._clear (); } return false; }
will allow you to:
$ (document) .ready (function ($) {$ ('# draggable'). Draggable ({Revert: true, reverting: function () {console.log ('reverted');}, stop: function (event) {if (event.reverted) {console.log ('reverted')}}}}) ;});
Comments
Post a Comment