angularjs-dragula icon indicating copy to clipboard operation
angularjs-dragula copied to clipboard

Is it possible to disable the draggability without removing the directive?

Open LBiv opened this issue 9 years ago • 2 comments

I have a request call which populated a bag for me, but if I start dragging while it's getting populated it's understandably resulting in very buggy behavior. I was thinking maybe there's a way to toggle the dragging feature until the bag is fully populated to avoid the buggy behavior.

LBiv avatar May 02 '16 16:05 LBiv

+1

karneaud avatar May 27 '16 14:05 karneaud

@LBiv Checkout: https://github.com/bevacqua/dragula#dragulacontainers-options https://github.com/bevacqua/angular-dragula#drake-options

By default, the moves option returns true, but you can inject dragulaService into your directive and overwrite the moves function with something like:

dragulaService.options($scope, 'orders-bag', {
  moves: function (el, source, handle, sibling) {
    return foo
  }
});

Where foo can be a $scope value or the result of some function call.

tomarak avatar Nov 01 '16 18:11 tomarak