ngRepeatReorder icon indicating copy to clipboard operation
ngRepeatReorder copied to clipboard

Problems with bower install and suggestion for a callback

Open Kartoffelsalat opened this issue 11 years ago • 1 comments

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.

Kartoffelsalat avatar Sep 24 '14 14:09 Kartoffelsalat

OK, I think this is a duplicate of #15 - can you confirm?

SimeonC avatar Sep 30 '14 02:09 SimeonC