1
+ 'use strict' ;
2
+
1
3
/*
2
4
jQuery UI Sortable plugin wrapper
3
5
@@ -12,7 +14,7 @@ angular.module('ui.sortable', [])
12
14
link : function ( scope , element , attrs , ngModel ) {
13
15
14
16
function combineCallbacks ( first , second ) {
15
- if ( second && ( typeof second === " function" ) ) {
17
+ if ( second && ( typeof second === ' function' ) ) {
16
18
return function ( e , ui ) {
17
19
first ( e , ui ) ;
18
20
second ( e , ui ) ;
@@ -30,7 +32,7 @@ angular.module('ui.sortable', [])
30
32
stop :null ,
31
33
update :null
32
34
} ;
33
-
35
+
34
36
var apply = function ( e , ui ) {
35
37
if ( ui . item . sortable . resort || ui . item . sortable . relocate ) {
36
38
scope . $apply ( ) ;
@@ -42,7 +44,7 @@ angular.module('ui.sortable', [])
42
44
if ( ngModel ) {
43
45
44
46
ngModel . $render = function ( ) {
45
- element . sortable ( " refresh" ) ;
47
+ element . sortable ( ' refresh' ) ;
46
48
} ;
47
49
48
50
callbacks . start = function ( e , ui ) {
@@ -85,13 +87,13 @@ angular.module('ui.sortable', [])
85
87
}
86
88
} ;
87
89
88
- scope . $watch ( attrs . uiSortable , function ( newVal , oldVal ) {
90
+ scope . $watch ( attrs . uiSortable , function ( newVal ) {
89
91
angular . forEach ( newVal , function ( value , key ) {
90
92
91
93
if ( callbacks [ key ] ) {
92
94
// wrap the callback
93
95
value = combineCallbacks ( callbacks [ key ] , value ) ;
94
-
96
+
95
97
if ( key === 'stop' ) {
96
98
// call apply after stop
97
99
value = combineCallbacks ( value , apply ) ;
@@ -106,7 +108,7 @@ angular.module('ui.sortable', [])
106
108
107
109
opts [ key ] = combineCallbacks ( value , opts [ key ] ) ;
108
110
} ) ;
109
-
111
+
110
112
// call apply after stop
111
113
opts . stop = combineCallbacks ( opts . stop , apply ) ;
112
114
0 commit comments