Moved Page Interaction Blocking class stuff into a prop

This commit is contained in:
Leah Schumann 2023-07-17 08:44:43 -04:00
parent 55e4623128
commit 029d65ae44
2 changed files with 22 additions and 9 deletions

View file

@ -25,8 +25,10 @@
<span v-if="!isLoaderDisplayed" class="m-0 button-auxillary-copy">{{ <span v-if="!isLoaderDisplayed" class="m-0 button-auxillary-copy">{{
badgeText badgeText
}}</span> }}</span>
<loader v-if="isLoaderDisplayed" :class="['left', 'no-block']" /> <loader
<!-- no-block allows the user to click between shops while availability indicators are loading --> v-if="isLoaderDisplayed"
:loaderPosition="left"
:allowPageInteraction="true" />
</div> </div>
</div> </div>
<div class="row-two"> <div class="row-two">
@ -74,10 +76,11 @@ export default {
}, },
computed: { computed: {
displayAvailabilityIndicators() { displayAvailabilityIndicators() {
return experimentMixin.methods.hasSettingEqualTo( return true;
experimentSettings.DISPLAY_AVAILABILITY_INDICATORS, // return experimentMixin.methods.hasSettingEqualTo(
"true" // experimentSettings.DISPLAY_AVAILABILITY_INDICATORS,
); // "true"
// );
}, },
isLoaderDisplayed() { isLoaderDisplayed() {
return this.availabilityRating == null; return this.availabilityRating == null;

View file

@ -3,7 +3,11 @@
class="loader" class="loader"
role="alert" role="alert"
aria-label="Loading new page" aria-label="Loading new page"
v-bind:class="[this.loaderColor, this.loaderPosition]"></div> v-bind:class="[
this.loaderColor,
this.loaderPosition,
this.allowPageInteraction ? 'allow-ui-interaction' : '',
]"></div>
</template> </template>
<script> <script>
@ -19,6 +23,12 @@ export default {
loaderPosition: { loaderPosition: {
type: String, type: String,
}, },
/* Set to true for loaders where UI interaction must be allowed to continue while the loader is active
(See example shop-list-button) */
allowPageInteraction: {
type: Boolean,
default: false,
},
}, },
}; };
</script> </script>
@ -83,8 +93,8 @@ export default {
&.black:after { &.black:after {
background-color: $black; background-color: $black;
} }
//no-block to enable clicking on certain buttons with loaders while the loader is actives &.allow-ui-interaction::before {
&.no-block::before { //no-block to enable clicking on certain buttons with loaders while the loader is actives
z-index: -1; z-index: -1;
} }
} }