Skip to content

Commit 1c48b1f

Browse files
committed
Code formatting, minor fixes
1 parent 8996de2 commit 1c48b1f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/components/QuestionTypes/OpinionScaleType.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
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)"
@@ -56,12 +56,12 @@
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() {
@@ -153,12 +153,12 @@
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) {
@@ -181,10 +181,10 @@
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
@@ -198,7 +198,7 @@
198198
}
199199
200200
return false
201-
},
201+
}
202202
}
203203
}
204204
</script>

0 commit comments

Comments
 (0)