Merge pull request #1238 from Safelite/defect/CSR-1469

Moved Page Interaction Blocking class stuff into a prop
This commit is contained in:
Leah Schumann 2023-07-17 08:57:32 -04:00 committed by GitHub
commit 5a9ab3b565
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View file

@ -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">

View file

@ -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;
}
}