File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
src/components/QuestionTypes Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 4
4
<li
5
5
v-for =" (option, index) in question.options"
6
6
v-on:click.prevent =" toggleAnswer(option)"
7
- v-on:mouseover =" isIconScale ? onMouseover(index) : null "
8
- v-on:mouseleave =" isIconScale ? onMouseleave() : null "
7
+ v-on:mouseover =" isIconScale && onMouseover(index)"
8
+ v-on:mouseleave =" isIconScale && onMouseleave()"
9
9
v-bind:class =" {'f-selected': option.selected, ...iconScaleClasses(index)}"
10
10
v-bind:key =" 'm' + index"
11
11
v-bind:aria-label =" getLabel(option.value)"
56
56
return {
57
57
isIconScale: false ,
58
58
hoveredIndex: null ,
59
- activeIndex: null ,
59
+ activeIndex: null
60
60
}
61
61
},
62
62
63
63
mixins: [
64
- IsMobile,
64
+ IsMobile
65
65
],
66
66
67
67
beforeMount () {
153
153
this ._toggleAnswer (option)
154
154
},
155
155
156
- async _toggleAnswer (option ) {
156
+ _toggleAnswer (option ) {
157
157
const optionValue = option .choiceValue ()
158
158
159
159
option .toggle ()
160
+
160
161
this .activeIndex = option .selected ? this .question .options .indexOf (option) : null
161
-
162
162
this .dataValue = option .selected ? optionValue : null
163
163
164
164
if (this .isValid () && this .question .nextStepOnAnswer && ! this .disabled ) {
181
181
182
182
if (this .isIconScale ) {
183
183
if (! this .isMobile ) {
184
- classes[' f-hovered' ] = this .hoveredIndex ? index < this .hoveredIndex : null
184
+ classes[' f-hovered' ] = this .hoveredIndex && index < this .hoveredIndex
185
185
}
186
186
187
- classes[' f-previous' ] = this .activeIndex ? index < this .activeIndex : null
187
+ classes[' f-previous' ] = this .activeIndex && index < this .activeIndex
188
188
}
189
189
190
190
return classes
198
198
}
199
199
200
200
return false
201
- },
201
+ }
202
202
}
203
203
}
204
204
< / script>
You can’t perform that action at this time.
0 commit comments