Skip to content

Commit

Permalink
fix(survey): disable controls when overlay active
Browse files Browse the repository at this point in the history
  • Loading branch information
lukashroch committed Oct 20, 2022
1 parent 456d665 commit 0341eb6
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
</v-row>
<v-row v-if="asServedData">
<v-col class="pa-1 rounded-lg" cols="3" lg="1" sm="2">
<v-card @click="updateSelection(-1)">
<v-card :disabled="isLessWeightFactorActive" @click="updateSelection(-1)">
<v-img :src="firstThumbnail"></v-img>
<v-overlay absolute>
<v-btn icon large>
<v-btn :disabled="isLessWeightFactorActive" icon large>
<v-icon>fas fa-fw fa-minus</v-icon>
</v-btn>
</v-overlay>
Expand All @@ -37,10 +37,10 @@
</v-col>
</template>
<v-col v-if="showMoreWeightFactor" class="pa-1 mr-auto rounded-lg" cols="3" lg="1" sm="2">
<v-card @click="updateSelection(1)">
<v-card :disabled="isMoreWeightFactorActive" @click="updateSelection(1)">
<v-img :src="lastThumbnail"></v-img>
<v-overlay absolute>
<v-btn icon large>
<v-btn :disabled="isMoreWeightFactorActive" icon large>
<v-icon>fas fa-fw fa-plus</v-icon>
</v-btn>
</v-overlay>
Expand All @@ -49,12 +49,12 @@
</v-row>
<v-row>
<v-col>
<v-btn block @click="updateSelection(-1)">
<v-btn block :disabled="isLessWeightFactorActive" @click="updateSelection(-1)">
{{ $t(`portion.as-served.${type}.less`) }}
</v-btn>
</v-col>
<v-col>
<v-btn block @click="updateSelection(1)">
<v-btn block :disabled="isMoreWeightFactorActive" @click="updateSelection(1)">
{{ $t(`portion.as-served.${type}.more`) }}
</v-btn>
</v-col>
Expand Down Expand Up @@ -183,6 +183,12 @@ export default defineComponent({
return this.asServedData?.images[this.objectIdx].mainImageUrl ?? '';
},
isLessWeightFactorActive(): boolean {
return this.weightFactorProps.show && this.weightFactorProps.subType === 'less';
},
isMoreWeightFactorActive(): boolean {
return this.weightFactorProps.show && this.weightFactorProps.subType === 'more';
},
thumbnailWeight(): string | null {
if (this.objectIdx === undefined || !this.asServedData) return null;
Expand Down

0 comments on commit 0341eb6

Please sign in to comment.