Skip to content

Commit 9e93358

Browse files
committed
Update ng-sortable.js
1 parent 5b4737f commit 9e93358

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

ng-sortable.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
.directive('ngSortable', ['$parse', 'ngSortableConfig', function ($parse, ngSortableConfig) {
3131
var removed,
3232
nextSibling;
33-
34-
35-
33+
3634
// Export
3735
return {
3836
restrict: 'AC',
@@ -59,9 +57,6 @@
5957
var itemsExpr = $parse(ngRepeat[2]);
6058

6159
return {
62-
item: function (el) {
63-
return itemExpr(angular.element(el).scope());
64-
},
6560
items: function () {
6661
return itemsExpr(scope);
6762
}
@@ -81,7 +76,7 @@
8176

8277
/* jshint expr:true */
8378
options[name] && options[name]({
84-
model: item || source && source.item(evt.item),
79+
model: item || source && source.items()[evt.newIndex],
8580
models: source && source.items(),
8681
oldIndex: evt.oldIndex,
8782
newIndex: evt.newIndex

0 commit comments

Comments
 (0)