@@ -55,13 +55,13 @@ import 'vue-awesome/icons/plus';
5555import ' vue-awesome/icons/edit' ;
5656
5757export default {
58- name: " CategoryEditTree" ,
58+ name: ' CategoryEditTree' ,
5959 props: {
6060 cls: Object ,
6161 depth: {
6262 type: Number ,
6363 default: 0 ,
64- }
64+ },
6565 },
6666 data : () => {
6767 return {
@@ -76,21 +76,26 @@ export default {
7676 },
7777 computed: {
7878 allCategories : function () {
79- const categories = this .$store .getters [" settings/all_categories" ];
80- const entries = categories .map (c => { return { text: c .join (" ->" ), value: c } });
81- return [{ value: [], text: ' None' }].concat (entries);
79+ const categories = this .$store .getters [' settings/all_categories' ];
80+ const entries = categories .map (c => {
81+ return { text: c .join (' ->' ), value: c };
82+ });
83+ return [{ value: [], text: ' None' }].concat (entries);
8284 },
8385 allRuleTypes : function () {
8486 return [
8587 { value: null , text: ' None' },
8688 { value: ' regex' , text: ' Regular Expression' },
8789 // { value: 'glob', text: 'Glob pattern' },
88- ]
90+ ];
8991 },
9092 },
9193 methods: {
9294 addSubclass : function (parent ) {
93- this .$store .commit (' settings/addClass' , {name: parent .name .concat ([" New class" ]), rule: {type: " regex" , regex: " FILL ME" }});
95+ this .$store .commit (' settings/addClass' , {
96+ name: parent .name .concat ([' New class' ]),
97+ rule: { type: ' regex' , regex: ' FILL ME' },
98+ });
9499 },
95100 removeClass : function (cls ) {
96101 // TODO: Show a confirmation dialog
@@ -99,22 +104,22 @@ export default {
99104 this .$store .commit (' settings/removeClass' , cls);
100105 },
101106 showEditModal (event ) {
102- this .$refs .edit .show ()
107+ this .$refs .edit .show ();
103108 },
104109 checkFormValidity () {
105110 // FIXME
106111 return true ;
107112 },
108113 handleOk (event ) {
109114 // Prevent modal from closing
110- event .preventDefault ()
115+ event .preventDefault ();
111116 // Trigger submit handler
112- this .handleSubmit ()
117+ this .handleSubmit ();
113118 },
114119 handleSubmit () {
115120 // Exit when the form isn't valid
116121 if (! this .checkFormValidity ()) {
117- return
122+ return ;
118123 }
119124
120125 // Save the category
@@ -123,12 +128,12 @@ export default {
123128 name: this .editing .parent .concat (this .editing .name ),
124129 rule: this .editing .rule .type !== null ? this .editing .rule : { type: null },
125130 };
126- this .$store .commit (" settings/updateClass" , new_class);
131+ this .$store .commit (' settings/updateClass' , new_class);
127132
128133 // Hide the modal manually
129134 this .$nextTick (() => {
130- this .$refs .edit .hide ()
131- })
135+ this .$refs .edit .hide ();
136+ });
132137 },
133138 resetModal () {
134139 this .editing = {
@@ -139,13 +144,13 @@ export default {
139144 };
140145 // console.log(this.editing);
141146 },
142- }
143- }
147+ },
148+ };
144149 </script >
145150
146151<style scoped lang="scss">
147152.row.cls :hover {
148- background-color : #EEE ;
153+ background-color : #eee ;
149154 boder-radius : 5px ;
150155}
151156 </style >
0 commit comments