I use angular-js dragula for drag&drop
I need to save position, because user choose custom div position. This is how my html look
<div class='wrapper'>
<div class='container' dragula='"first-bag"'>
<div>You can move these elements between these two containers</div>
<div>Moving them anywhere else isn't quite possible</div>
<div>There's also the possibility of moving elements around in the same container, changing their position</div>
</div>
</div>
With $scope.$on
I get over
and out
event, but I can't get id
or something similar for get position, to store in cookie.
$scope.$on('first-bag.over', function (e, el) {
el.addClass('over');
console.log(e);
console.log(el);
})
$scope.$on('first-bag.out', function (e, el) {
el.removeClass('over');
console.log(e);
console.log(el);
});
Here is plunker, open console to see what happens. Pls, if someone knows how to on every drag&drop save div order, soo next time when user come back to get saved position. Thnx