Skip to content

Commit

Permalink
Both enabled and disabled are checked for styling but not for loc…
Browse files Browse the repository at this point in the history
…ation checking. Add a check in the location function.

Ref : Commands with option `enabled: false` are still selectable #69
  • Loading branch information
maxkfranz committed May 30, 2018
1 parent 5669757 commit bb4cd29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
select: function(ele){
console.log( ele.data('name') );
},
disabled: true
enabled: false
},

{
Expand Down
2 changes: 1 addition & 1 deletion src/cxtmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ let cxtmenu = function(params){
let inThisCommand = theta1 <= theta && theta <= theta2
|| theta1 <= theta + 2*Math.PI && theta + 2*Math.PI <= theta2;

if( command.disabled ){
if( command.disabled === true || command.enabled === false ){
inThisCommand = false;
}

Expand Down

0 comments on commit bb4cd29

Please sign in to comment.