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

Commit

Permalink
jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
wuliupo committed Jul 20, 2016
1 parent 10589b6 commit 8e728b4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ angular.module('ui.sortable', [])
return first;
}

function wrappersHelper(inner) {
return function (e, item) {
var oldItemSortable = item.sortable;
var index = getItemIndex(item);
item.sortable = {
model: ngModel.$modelValue[index],
index: index,
source: item.parent(),
sourceModel: ngModel.$modelValue,
_restore: function () {
delete item.sortable;
item.sortable = oldItemSortable;
}
};

var innerResult = inner.apply(this, arguments);
item.sortable._restore();
item.sortable._isCustomHelperUsed = item !== innerResult;
return innerResult;
};
}

function getSortableWidgetInstance(element) {
// this is a fix to support jquery-ui prior to v1.11.x
// otherwise we should be using `element.sortable('instance')`
Expand Down Expand Up @@ -363,28 +385,6 @@ angular.module('ui.sortable', [])
}
};

function wrappersHelper(inner) {
return function (e, item) {
var oldItemSortable = item.sortable;
var index = getItemIndex(item);
item.sortable = {
model: ngModel.$modelValue[index],
index: index,
source: item.parent(),
sourceModel: ngModel.$modelValue,
_restore: function () {
delete item.sortable;
item.sortable = oldItemSortable;
}
};

var innerResult = inner.apply(this, arguments);
item.sortable._restore();
item.sortable._isCustomHelperUsed = item !== innerResult;
return innerResult;
};
};

scope.$watchCollection('uiSortable', function(newVal, oldVal) {
// ensure that the jquery-ui-sortable widget instance
// is still bound to the directive's element
Expand Down

0 comments on commit 8e728b4

Please sign in to comment.