Currently, if the outofbounds variable is true, this stops angular-ui-tree from updating the source array BUT, the beforeDrop callback is called prior to this, and doesn't have access to the outofbounds variable. I use the beforeDrop function to update the API with the move data, so it was doing the api call even if the move was 'out of bounds'. I solved this by passing the outOfBounds var to the callback data like so:
var dragEventArgs = dragInfo.eventArgs(elements, pos, outOfBounds);
and then updating the eventArgs function:
eventArgs: function (elements, pos, outOfBounds) {
return {
source: this.sourceInfo,
dest: {
index: this.index,
nodesScope: this.parent,
outOfBounds: outOfBounds
},
elements: elements,
pos: pos
};
},
I'm then able to make sure event.dest.outOfBounds is false before updating the api
Currently, if the outofbounds variable is true, this stops angular-ui-tree from updating the source array BUT, the beforeDrop callback is called prior to this, and doesn't have access to the outofbounds variable. I use the beforeDrop function to update the API with the move data, so it was doing the api call even if the move was 'out of bounds'. I solved this by passing the outOfBounds var to the callback data like so:
var dragEventArgs = dragInfo.eventArgs(elements, pos, outOfBounds);and then updating the eventArgs function:
I'm then able to make sure event.dest.outOfBounds is false before updating the api