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 44 <li
55 v-for =" (option, index) in question.options"
66 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()"
99 v-bind:class =" {'f-selected': option.selected, ...iconScaleClasses(index)}"
1010 v-bind:key =" 'm' + index"
1111 v-bind:aria-label =" getLabel(option.value)"
5656 return {
5757 isIconScale: false ,
5858 hoveredIndex: null ,
59- activeIndex: null ,
59+ activeIndex: null
6060 }
6161 },
6262
6363 mixins: [
64- IsMobile,
64+ IsMobile
6565 ],
6666
6767 beforeMount () {
153153 this ._toggleAnswer (option)
154154 },
155155
156- async _toggleAnswer (option ) {
156+ _toggleAnswer (option ) {
157157 const optionValue = option .choiceValue ()
158158
159159 option .toggle ()
160+
160161 this .activeIndex = option .selected ? this .question .options .indexOf (option) : null
161-
162162 this .dataValue = option .selected ? optionValue : null
163163
164164 if (this .isValid () && this .question .nextStepOnAnswer && ! this .disabled ) {
181181
182182 if (this .isIconScale ) {
183183 if (! this .isMobile ) {
184- classes[' f-hovered' ] = this .hoveredIndex ? index < this .hoveredIndex : null
184+ classes[' f-hovered' ] = this .hoveredIndex && index < this .hoveredIndex
185185 }
186186
187- classes[' f-previous' ] = this .activeIndex ? index < this .activeIndex : null
187+ classes[' f-previous' ] = this .activeIndex && index < this .activeIndex
188188 }
189189
190190 return classes
198198 }
199199
200200 return false
201- },
201+ }
202202 }
203203 }
204204< / script>
You can’t perform that action at this time.
0 commit comments