bevacqua / angularjs-dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/angularjs-dragula
MIT License
509 stars 110 forks source link

Moves option not working with drop-model event #65

Closed reubenbrown closed 8 years ago

reubenbrown commented 8 years ago

In my setup I want to update the model once it has been dropped so I added a drop-model event

$scope.$on('bag-one.drop-model', function (el, target, source) {
  // Doing stuff here //
});

This works great! However I don't want to make the entire div draggable so I added the moves option to specify a specific element within the div to initiate the drag via the demo documentation

dragulaService.options($scope, 'bag-one', {
  moves: function (el, container, handle) {
    return handle.className === 'handle';
  }
});

This also works! However now with both snippets of code together the drop-model event is ignored.

How can I specify the part of the div I want to make draggable and also run the drop-model event when the div has been dropped in its new location?

reubenbrown commented 8 years ago

Believe it might be related to this issue

reubenbrown commented 8 years ago

Word to the wise: always check which version of the package you're using. Realized I was on 1.0.12, upgraded to 1.2.6 and everything works like a charm