Skip to content

Commit

Permalink
add support for sv-disabled to disable certain elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mnzaki committed May 2, 2017
1 parent b36c5a4 commit 36700ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/angular-sortable-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,12 @@
handle.off('mousedown touchstart', onMousedown);
});

handle.on('mousedown touchstart', onMousedown);
$attrs.$observe('svDisabled', disabled => {
disabled = $scope.$eval(disabled);
if (!disabled) handle.on('mousedown touchstart', onMousedown);
else handle.off('mousedown touchstart', onMousedown);
});

$scope.$watch('$ctrl.handle', function(customHandle){
if(customHandle){
handle.off('mousedown touchstart', onMousedown);
Expand Down

0 comments on commit 36700ee

Please sign in to comment.