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

Commit

Permalink
Travis commit : build 201
Browse files Browse the repository at this point in the history
  • Loading branch information
AngularUI (via TravisCI) committed Apr 10, 2014
1 parent 5f39fea commit d28a5e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-ui-sortable",
"version": "0.12.2",
"version": "0.12.3",
"main": "./sortable.js",
"dependencies": {
"angular": "~1.2.x",
Expand Down
29 changes: 18 additions & 11 deletions sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ angular.module('ui.sortable', [])
scope.$watch(attrs.ngModel+'.length', function() {
// Timeout to let ng-repeat modify the DOM
$timeout(function() {
// ensure that the jquery-ui-sortable widget instance
// is still bound to the directive's element
if (!!element.data('ui-sortable')) {
element.sortable('refresh');
}
Expand Down Expand Up @@ -176,18 +178,23 @@ angular.module('ui.sortable', [])
};

scope.$watch(attrs.uiSortable, function(newVal /*, oldVal*/) {
angular.forEach(newVal, function(value, key) {
if(callbacks[key]) {
if( key === 'stop' ){
// call apply after stop
value = combineCallbacks(
value, function() { scope.$apply(); });
// ensure that the jquery-ui-sortable widget instance
// is still bound to the directive's element
if (!!element.data('ui-sortable')) {
angular.forEach(newVal, function(value, key) {
if(callbacks[key]) {
if( key === 'stop' ){
// call apply after stop
value = combineCallbacks(
value, function() { scope.$apply(); });
}
// wrap the callback
value = combineCallbacks(callbacks[key], value);
}
// wrap the callback
value = combineCallbacks(callbacks[key], value);
}
element.sortable('option', key, value);
});

element.sortable('option', key, value);
});
}
}, true);

angular.forEach(callbacks, function(value, key) {
Expand Down
2 changes: 1 addition & 1 deletion sortable.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d28a5e6

Please sign in to comment.