Skip to content

Commit 36700ee

Browse files
committed
add support for sv-disabled to disable certain elements
1 parent b36c5a4 commit 36700ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/angular-sortable-view.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,12 @@
361361
handle.off('mousedown touchstart', onMousedown);
362362
});
363363

364-
handle.on('mousedown touchstart', onMousedown);
364+
$attrs.$observe('svDisabled', disabled => {
365+
disabled = $scope.$eval(disabled);
366+
if (!disabled) handle.on('mousedown touchstart', onMousedown);
367+
else handle.off('mousedown touchstart', onMousedown);
368+
});
369+
365370
$scope.$watch('$ctrl.handle', function(customHandle){
366371
if(customHandle){
367372
handle.off('mousedown touchstart', onMousedown);

0 commit comments

Comments
 (0)