@@ -3,7 +3,7 @@ import { mapMutations } from "vuex";
33export default {
44 data ( ) {
55 return {
6- commands : [ ]
6+ commands : [ ] ,
77 } ;
88 } ,
99 methods : {
@@ -13,22 +13,22 @@ export default {
1313 {
1414 default : [ "arrowup" ] ,
1515 function : this . moveUp ,
16- name : "Move Up Annotaitons"
16+ name : "Move Up Annotaitons" ,
1717 } ,
1818 {
1919 default : [ "arrowdown" ] ,
2020 function : this . moveDown ,
21- name : "Move Down Annotations"
21+ name : "Move Down Annotations" ,
2222 } ,
2323 {
2424 default : [ "arrowright" ] ,
2525 function : this . stepIn ,
26- name : "Expand Category"
26+ name : "Expand Category" ,
2727 } ,
2828 {
2929 default : [ "arrowleft" ] ,
3030 function : this . stepOut ,
31- name : "Collapse Category"
31+ name : "Collapse Category" ,
3232 } ,
3333 {
3434 default : [ "space" ] ,
@@ -37,7 +37,7 @@ export default {
3737 if ( this . currentCategory ) {
3838 this . currentCategory . createAnnotation ( ) ;
3939 }
40- }
40+ } ,
4141 } ,
4242 {
4343 default : [ "delete" ] ,
@@ -46,98 +46,99 @@ export default {
4646 if ( this . currentAnnotation ) {
4747 this . currentAnnotation . deleteAnnotation ( ) ;
4848 }
49- }
49+ } ,
5050 } ,
5151 {
5252 default : [ "control" , "z" ] ,
5353 name : "Undo Last Action" ,
54- function : this . undo
54+ function : this . undo ,
5555 } ,
5656 {
5757 default : [ "s" ] ,
5858 name : "Select Tool" ,
5959 function : ( ) => {
6060 this . activeTool = "Select" ;
61- }
61+ } ,
6262 } ,
6363 {
6464 default : [ "p" ] ,
6565 name : "Polygon Tool" ,
6666 function : ( ) => {
67- this . activeTool = "Polygon" ;
68- }
67+ if ( this . $refs . polygon . isDisabled ) wwthis . activeTool = "Polygon" ;
68+ } ,
6969 } ,
7070 {
7171 default : [ "w" ] ,
7272 name : "Magic Wand Tool" ,
7373 function : ( ) => {
74- this . activeTool = "Magic Wand" ;
75- }
74+ if ( ! this . $refs . magicwand . isDisabled )
75+ this . activeTool = "Magic Wand" ;
76+ } ,
7677 } ,
7778 {
7879 default : [ "b" ] ,
7980 name : "Brush Tool" ,
8081 function : ( ) => {
81- this . activeTool = "Brush" ;
82- }
82+ if ( this . $refs . brush . isDisabled ) this . activeTool = "Brush" ;
83+ } ,
8384 } ,
8485 {
8586 default : [ "e" ] ,
8687 name : "Eraser Tool" ,
8788 function : ( ) => {
88- this . activeTool = "Eraser" ;
89- }
89+ if ( this . $refs . eraser . isDisabled ) this . activeTool = "Eraser" ;
90+ } ,
9091 } ,
9192 {
9293 default : [ "c" ] ,
9394 name : "Center Image" ,
94- function : this . fit
95+ function : this . fit ,
9596 } ,
9697 {
9798 default : [ "control" , "s" ] ,
9899 name : "Save" ,
99- function : this . save
100+ function : this . save ,
100101 } ,
101102 {
102103 title : "Polygon Tool Shortcuts" ,
103104 default : [ "escape" ] ,
104105 name : "Remove Current Polygon" ,
105- function : this . $refs . polygon . deletePolygon
106+ function : this . $refs . polygon . deletePolygon ,
106107 } ,
107108 {
108109 title : "Eraser Tool Shortcuts" ,
109110 default : [ "[" ] ,
110111 name : "Increase Radius" ,
111- function : this . $refs . eraser . increaseRadius
112+ function : this . $refs . eraser . increaseRadius ,
112113 } ,
113114 {
114115 default : [ "]" ] ,
115116 name : "Decrease Radius" ,
116- function : this . $refs . eraser . decreaseRadius
117+ function : this . $refs . eraser . decreaseRadius ,
117118 } ,
118119 {
119120 title : "Brush Tool Shortcuts" ,
120121 default : [ "[" ] ,
121122 name : "Increase Radius" ,
122- function : this . $refs . brush . increaseRadius
123+ function : this . $refs . brush . increaseRadius ,
123124 } ,
124125 {
125126 default : [ "]" ] ,
126127 name : "Decrease Radius" ,
127- function : this . $refs . brush . decreaseRadius
128+ function : this . $refs . brush . decreaseRadius ,
128129 } ,
129130 {
130131 title : "Magic Tool Shortcuts" ,
131132 default : [ "shift" , "click" ] ,
132133 name : "Subtract Selection" ,
133- readonly : true
134- }
134+ readonly : true ,
135+ } ,
135136 ] ;
136- }
137+ } ,
137138 } ,
138139 mounted ( ) {
139140 if ( this . $route . name === "annotate" ) {
140141 this . commands = this . annotator ( ) ;
141142 }
142- }
143+ } ,
143144} ;
0 commit comments