99 <!-- Edit Tag -->
1010 <template v-if =" editingLabelId === label .id " >
1111 <form class =" label-form" @submit.prevent =" updateLabel(label)" >
12- <NcColorPicker class = " color-picker-wrapper "
13- :value = " '#' + editingLabel. color"
12+ <NcColorPicker v-model = " editingLabelColor "
13+ class = " color-picker-wrapper "
1414 :advanced-fields =" true"
15- @input =" updateColor" >
16- <div :style =" { backgroundColor: '#' + editingLabel.color }" class =" color0 icon-colorpicker" />
15+ @submit =" updateColor" >
16+ <div :style =" { backgroundColor: editingLabelColor }" class =" color0 icon-colorpicker" />
1717 </NcColorPicker >
1818 <input v-model =" editingLabel.title" type =" text" >
1919 <input :disabled =" !editLabelObjValidated"
5656 <li v-if =" addLabel" class =" editing" >
5757 <!-- New Tag -->
5858 <form class =" label-form" @submit.prevent =" clickAddLabel" >
59- <NcColorPicker class = " color-picker-wrapper "
60- :value = " '#' + addLabelObj. color"
59+ <NcColorPicker v-model = " addLabelColor "
60+ class = " color-picker-wrapper "
6161 :advanced-fields =" true"
6262 @input =" updateColor" >
63- <div :style =" { backgroundColor: '#' + addLabelObj.color }" class =" color0 icon-colorpicker" />
63+ <div :style =" { backgroundColor: addLabelColor }" class =" color0 icon-colorpicker" />
6464 </NcColorPicker >
6565 <input v-model =" addLabelObj.title" type =" text" >
6666 <input :disabled =" !addLabelObjValidated"
@@ -102,8 +102,10 @@ export default {
102102 return {
103103 editingLabelId: null ,
104104 editingLabel: null ,
105+ editingLabelColor: null ,
105106 addLabelObj: null ,
106107 addLabel: false ,
108+ addLabelColor: null ,
107109 missingDataLabel: t (' deck' , ' title and color value must be provided' ),
108110 defaultColors: [' 31CC7C' , ' 17CCC' , ' FF7A66' , ' F1DB50' , ' 7C31CC' , ' CC317C' , ' 3A3B3D' , ' CACBCD' ],
109111 }
@@ -152,6 +154,7 @@ export default {
152154 clickEdit (label ) {
153155 this .editingLabelId = label .id
154156 this .editingLabel = Object .assign ({}, label)
157+ this .editingLabelColor = ' #' + label .color
155158 },
156159 deleteLabel (id ) {
157160 this .$store .dispatch (' removeLabelFromCurrentBoard' , id)
@@ -162,12 +165,14 @@ export default {
162165 },
163166 clickShowAddLabel () {
164167 this .addLabelObj = { cardId: null , color: this .defaultColors [Math .floor (Math .random () * this .defaultColors .length )], title: ' ' }
168+ this .addLabelColor = ' #' + this .addLabelObj .color
165169 this .addLabel = true
166170 },
167171 clickAddLabel () {
168172 this .$store .dispatch (' addLabelToCurrentBoard' , this .addLabelObj )
169173 this .addLabel = false
170174 this .addLabelObj = null
175+ this .addLabelColor = null
171176 },
172177 },
173178}
0 commit comments