ngRepeatReorder
ngRepeatReorder copied to clipboard
Problems with bower install and suggestion for a callback
I tried it with angular 1.2.25 and 1.3.x, the bower installed hammerjs (>1.0.5) and angular-hammer(>1.0.1) and i got some errors, angular complains about dom manipulating.
Another suggestion: Do you think u can add a callback on stopevent? callback(startindex, endindex)
I did something like this in your code: line 334 - 350
var $endindex = false;
collection = $scope.$eval(rhs);
obj = collection.splice($index, 1);
if (this.offset < 0) {
collection.splice($index + this.offset + 1, 0, obj[0]);
$endindex = $index + this.offset + 1;
} else if (this.offset > 0) {
collection.splice($index + this.offset - 1, 0, obj[0]);
$endindex = $index + this.offset - 1;
}
$scope.$emit('ngrr-reordered');
if (typeof $scope.onReordered === 'function') {
$scope.onReordered($index, $endindex);
}
And defined the onReordered function in my controller.
OK, I think this is a duplicate of #15 - can you confirm?