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

Commit 8e728b4

Browse files
committed
jshint
1 parent 10589b6 commit 8e728b4

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/sortable.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,28 @@ angular.module('ui.sortable', [])
3535
return first;
3636
}
3737

38+
function wrappersHelper(inner) {
39+
return function (e, item) {
40+
var oldItemSortable = item.sortable;
41+
var index = getItemIndex(item);
42+
item.sortable = {
43+
model: ngModel.$modelValue[index],
44+
index: index,
45+
source: item.parent(),
46+
sourceModel: ngModel.$modelValue,
47+
_restore: function () {
48+
delete item.sortable;
49+
item.sortable = oldItemSortable;
50+
}
51+
};
52+
53+
var innerResult = inner.apply(this, arguments);
54+
item.sortable._restore();
55+
item.sortable._isCustomHelperUsed = item !== innerResult;
56+
return innerResult;
57+
};
58+
}
59+
3860
function getSortableWidgetInstance(element) {
3961
// this is a fix to support jquery-ui prior to v1.11.x
4062
// otherwise we should be using `element.sortable('instance')`
@@ -363,28 +385,6 @@ angular.module('ui.sortable', [])
363385
}
364386
};
365387

366-
function wrappersHelper(inner) {
367-
return function (e, item) {
368-
var oldItemSortable = item.sortable;
369-
var index = getItemIndex(item);
370-
item.sortable = {
371-
model: ngModel.$modelValue[index],
372-
index: index,
373-
source: item.parent(),
374-
sourceModel: ngModel.$modelValue,
375-
_restore: function () {
376-
delete item.sortable;
377-
item.sortable = oldItemSortable;
378-
}
379-
};
380-
381-
var innerResult = inner.apply(this, arguments);
382-
item.sortable._restore();
383-
item.sortable._isCustomHelperUsed = item !== innerResult;
384-
return innerResult;
385-
};
386-
};
387-
388388
scope.$watchCollection('uiSortable', function(newVal, oldVal) {
389389
// ensure that the jquery-ui-sortable widget instance
390390
// is still bound to the directive's element

0 commit comments

Comments
 (0)