Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit e20710b

Browse files
committed
Merge pull request #295 from fishfacemcgee/clean-attrs
fix(sortable): also check 'data-ng-model' in update callback
2 parents aedb58f + bef515e commit e20710b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/sortable.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ angular.module('ui.sortable', [])
150150
ui.item.sortable.dropindex = ui.item.index();
151151
var droptarget = ui.item.parent();
152152
ui.item.sortable.droptarget = droptarget;
153-
ui.item.sortable.droptargetModel = droptarget.scope().$eval(droptarget.attr('ng-model'));
153+
var attr = droptarget.attr('ng-model') || droptarget.attr('data-ng-model');
154+
ui.item.sortable.droptargetModel = droptarget.scope().$eval(attr);
154155

155156
// Cancel the sort (let ng-repeat do the sort for us)
156157
// Don't cancel if this is the received list because it has
@@ -284,7 +285,7 @@ angular.module('ui.sortable', [])
284285
} else if (wrappers[key]) {
285286
value = wrappers[key](value);
286287
}
287-
288+
288289
opts[key] = value;
289290
element.sortable('option', key, value);
290291
});

0 commit comments

Comments
 (0)