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

Moved inside 'if (ngModel){}' any code that calls combineCallbacks and a... #37

Merged
merged 1 commit into from
Oct 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/
angular.module('ui.sortable', [])
.value('uiSortableConfig',{})
.directive('uiSortable', [ 'uiSortableConfig',
function(uiSortableConfig) {
.directive('uiSortable', [ 'uiSortableConfig', '$log',
function(uiSortableConfig, log) {
return {
require: '?ngModel',
link: function(scope, element, attrs, ngModel) {
Expand Down Expand Up @@ -85,9 +85,6 @@ angular.module('ui.sortable', [])
}
};

}


scope.$watch(attrs.uiSortable, function(newVal, oldVal){
angular.forEach(newVal, function(value, key){

Expand All @@ -113,8 +110,11 @@ angular.module('ui.sortable', [])
// call apply after stop
opts.stop = combineCallbacks( opts.stop, apply );

// Create sortable
} else {
log.info('ui.sortable: ngModel not provided!', element);
}

// Create sortable
element.sortable(opts);
}
};
Expand Down