Moved Page Interaction Blocking class stuff into a prop
This commit is contained in:
parent
55e4623128
commit
029d65ae44
2 changed files with 22 additions and 9 deletions
|
|
@ -25,8 +25,10 @@
|
|||
<span v-if="!isLoaderDisplayed" class="m-0 button-auxillary-copy">{{
|
||||
badgeText
|
||||
}}</span>
|
||||
<loader v-if="isLoaderDisplayed" :class="['left', 'no-block']" />
|
||||
<!-- no-block allows the user to click between shops while availability indicators are loading -->
|
||||
<loader
|
||||
v-if="isLoaderDisplayed"
|
||||
:loaderPosition="left"
|
||||
:allowPageInteraction="true" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-two">
|
||||
|
|
@ -74,10 +76,11 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
displayAvailabilityIndicators() {
|
||||
return experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.DISPLAY_AVAILABILITY_INDICATORS,
|
||||
"true"
|
||||
);
|
||||
return true;
|
||||
// return experimentMixin.methods.hasSettingEqualTo(
|
||||
// experimentSettings.DISPLAY_AVAILABILITY_INDICATORS,
|
||||
// "true"
|
||||
// );
|
||||
},
|
||||
isLoaderDisplayed() {
|
||||
return this.availabilityRating == null;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@
|
|||
class="loader"
|
||||
role="alert"
|
||||
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>
|
||||
|
||||
<script>
|
||||
|
|
@ -19,6 +23,12 @@ export default {
|
|||
loaderPosition: {
|
||||
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>
|
||||
|
|
@ -83,8 +93,8 @@ export default {
|
|||
&.black:after {
|
||||
background-color: $black;
|
||||
}
|
||||
//no-block to enable clicking on certain buttons with loaders while the loader is actives
|
||||
&.no-block::before {
|
||||
&.allow-ui-interaction::before {
|
||||
//no-block to enable clicking on certain buttons with loaders while the loader is actives
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue