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

Commit 6db6808

Browse files
committed
fix(sortable): fix 'data-ui-sortable' directive annotation error
1 parent 7c75125 commit 6db6808

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sortable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ angular.module('ui.sortable', [])
7676
$timeout(function() {
7777
// ensure that the jquery-ui-sortable widget instance
7878
// is still bound to the directive's element
79-
if (!!element.data('ui-sortable')) {
79+
if (!!element.sortable('instance')) {
8080
element.sortable('refresh');
8181
}
8282
}, 0, false);
@@ -87,7 +87,7 @@ angular.module('ui.sortable', [])
8787
// since the drag has started, the element will be
8888
// absolutely positioned, so we check its siblings
8989
var siblings = ui.item.siblings();
90-
angular.element(e.target).data('ui-sortable').floating = isFloating(siblings);
90+
angular.element(e.target).sortable('instance').floating = isFloating(siblings);
9191
}
9292

9393
// Save the starting position of dragged item
@@ -263,13 +263,13 @@ angular.module('ui.sortable', [])
263263
scope.$watch('uiSortable', function(newVal /*, oldVal*/) {
264264
// ensure that the jquery-ui-sortable widget instance
265265
// is still bound to the directive's element
266-
if (!!element.data('ui-sortable')) {
266+
if (!!element.sortable('instance')) {
267267
angular.forEach(newVal, function(value, key) {
268268
// if it's a custom option of the directive,
269269
// handle it approprietly
270270
if (key in directiveOpts) {
271271
if (key === 'ui-floating' && (value === false || value === true)) {
272-
element.data('ui-sortable').floating = value;
272+
element.sortable('instance').floating = value;
273273
}
274274

275275
opts[key] = value;

0 commit comments

Comments
 (0)