Skip to content

Commit a7c5b4f

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

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
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', function(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);

src/angular-sortable-view.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)