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

Commit d4d1558

Browse files
author
michaschwab
committed
now, ui sortable only starts if the disabled option is not set. once the disabled option is removed, ui sortable will launch.
1 parent 61c50b4 commit d4d1558

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/sortable.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,17 @@ angular.module('ui.sortable', [])
448448
$log.info('ui.sortable: ngModel not provided!', element);
449449
}
450450

451-
// Create sortable
452-
element.sortable(opts);
451+
var created = false;
452+
scope.$watch('uiSortable.disabled', function()
453+
{
454+
if(!created && !scope.uiSortable.disabled)
455+
{
456+
created = true;
457+
458+
// Create sortable
459+
element.sortable(opts);
460+
}
461+
});
453462
}
454463
};
455464
}

0 commit comments

Comments
 (0)