angular-dragdrop icon indicating copy to clipboard operation
angular-dragdrop copied to clipboard

revert item to the origin place if it is outside of dropped objects

Open orolin opened this issue 8 years ago • 1 comments

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}"

orolin avatar Feb 27 '17 14:02 orolin

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;
                }
}

cavoixanha avatar Jun 27 '18 07:06 cavoixanha