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

Commit 074fe90

Browse files
Jeremy Mickelsondouglasduteil
Jeremy Mickelson
authored andcommitted
Added the watch on the callbacks to as smithkl42 suggested. #48
1 parent 521fcc3 commit 074fe90

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/sortable.js

+10
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ angular.module('ui.sortable', [])
7878
});
7979
};
8080

81+
scope.$watch(attrs.uiSortable, function(newVal, oldVal){
82+
angular.forEach(newVal, function(value, key){
83+
if( callbacks[key] ){
84+
// wrap the callback
85+
value = combineCallbacks( callbacks[key], value );
86+
}
87+
element.sortable('option', key, value);
88+
});
89+
}, true);
90+
8191
angular.forEach(callbacks, function(value, key){
8292
opts[key] = combineCallbacks(value, opts[key]);
8393
});

0 commit comments

Comments
 (0)