File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 2222 }
2323
2424 var sortingInProgress ;
25+ var isDisabled = false ;
26+
2527 var ROOTS_MAP = Object . create ( null ) ;
2628 // window.ROOTS_MAP = ROOTS_MAP; // for debug purposes
2729
5658 return sortingInProgress ;
5759 } ;
5860
61+ if ( $attrs . svDisabled ) {
62+ $scope . $watch ( $attrs . svDisabled , function ( disabled ) {
63+ isDisabled = disabled === true ;
64+ } ) ;
65+ }
66+
67+ this . isDisabled = function ( ) {
68+ return isDisabled ;
69+ } ;
70+
5971 if ( $attrs . svGrid ) { // sv-grid determined explicite
6072 isGrid = $attrs . svGrid === "true" ? true : $attrs . svGrid === "false" ? false : null ;
6173 if ( isGrid === null )
361373 handle . off ( 'mousedown touchstart' , onMousedown ) ;
362374 } ) ;
363375
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-
376+ handle . on ( 'mousedown touchstart' , onMousedown ) ;
370377 $scope . $watch ( '$ctrl.handle' , function ( customHandle ) {
371378 if ( customHandle ) {
372379 handle . off ( 'mousedown touchstart' , onMousedown ) ;
397404 function onMousedown ( e ) {
398405 touchFix ( e ) ;
399406
400- if ( $controllers [ 1 ] . sortingInProgress ( ) ) return ;
407+ if ( $controllers [ 1 ] . isDisabled ( ) || $controllers [ 1 ] . sortingInProgress ( ) ) return ;
401408 if ( e . button != 0 && e . type === 'mousedown' ) return ;
402409
403410 moveExecuted = false ;
You can’t perform that action at this time.
0 commit comments