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

Allow for updates to the sortable options #4

Merged
merged 1 commit into from
May 21, 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
6 changes: 4 additions & 2 deletions src/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ angular.module('ui.sortable', []).value('uiSortableConfig',{}).directive('uiSort
return {
require: '?ngModel',
link: function(scope, element, attrs, ngModel) {
var onReceive, onRemove, onStart, onStop, onUpdate, opts;
var onReceive, onRemove, onStart, onStop, onUpdate, opts = {};

opts = angular.extend({}, uiSortableConfig, scope.$eval(attrs.uiSortable));
attrs.$observe('ui-sortable', function(){
opts = angular.extend({}, uiSortableConfig, scope.$eval(attrs.uiSortable));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be changed to simply:

angular.extend(opts, uiSortableConfig, scope.$eval(attrs.uiSortable));

});

if (ngModel) {

Expand Down