Skip to content

Conversation

orolin
Copy link

@orolin orolin commented Feb 27, 2017

If you finish dragging element outside dropped objects, the element doesn't move to original place, just stays where the dragging finished. In some cases you want to move it to the original position.

if you want to turn on, set parameter revertFromOutside to true, for example jqyoui-droppable="{index: {{$index}}, revertFromOutside: true}"

@cavoixanha
Copy link

cavoixanha commented Jun 27, 2018

You can revert don't edit library
By edit js of property BeforeDrop
<nameBeforeDrop> is name func of Before Drop

$scope.<nameBeforeDrop> = function (e, ui) {
               if (<condition>) {
                    // something
                    $(ui.draggable[0]).draggable( "option", "revert", true );
                    $(ui.draggable[0]).draggable( "option", "revertDuration", 200 );
                    var deferred = $q.defer();
                    return deferred.promise;
                }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants