From 1911b30f98e921b84c4e53ebfbbbbcd9af5fdd07 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 14 Mar 2020 22:10:28 +0100 Subject: [PATCH] :art: (fab) update fab button z index to overlap bulma select dropdown icon --- src/components/FabButton.vue | 29 +++++++++++++++++------------ src/registerServiceWorker.ts | 14 ++------------ 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/components/FabButton.vue b/src/components/FabButton.vue index 958fa9a..ec9a270 100644 --- a/src/components/FabButton.vue +++ b/src/components/FabButton.vue @@ -6,7 +6,8 @@ :class="getClass" :style="buttonStyle" :to="to" - @click.native="valid"> + @click.native="valid" + > @@ -22,7 +23,8 @@ class="button is-primary is-large is-fab" :class="getClass" :style="buttonStyle" - @click="valid"> + @click="valid" + > @@ -46,7 +48,7 @@ export default class Home extends Vue { public margin!: boolean @Prop({ type: Object, default: () => null }) public to!: any | null - @Prop({ type: Object, required: false, default: () => ({})}) + @Prop({ type: Object, required: false, default: () => ({}) }) public buttonStyle!: any public uniqueId: string = Date.now().toString() public isLoading: boolean = false @@ -59,14 +61,17 @@ export default class Home extends Vue { const main = document.getElementById('main') const fabElm = document.getElementById(`fab-${this.uniqueId}`) if (main && fabElm) { - document.addEventListener('scroll', throttle((evt) => { - this.showFull = main.getBoundingClientRect().top > 0 - if (this.showFull) { - fabElm.classList.remove('small') - } else { - fabElm.classList.add('small') - } - }, 150)) + document.addEventListener( + 'scroll', + throttle((evt) => { + this.showFull = main.getBoundingClientRect().top > 0 + if (this.showFull) { + fabElm.classList.remove('small') + } else { + fabElm.classList.add('small') + } + }, 150) + ) } } @@ -119,7 +124,7 @@ $padding-fab: 24px; bottom: $padding-fab; position: fixed; right: $padding-fab; - z-index: 2; + z-index: 5; border: 2px solid $white; } diff --git a/src/registerServiceWorker.ts b/src/registerServiceWorker.ts index 52559be..18b8e8f 100644 --- a/src/registerServiceWorker.ts +++ b/src/registerServiceWorker.ts @@ -25,10 +25,7 @@ if (process.env.NODE_ENV === 'production') { registrationOptions: {}, ready() { notif.success('Application mise à jour !') - console.log( - 'App is being served from cache by a service worker.\n' + - 'For more details, visit https://goo.gl/AFskqB' - ) + console.log('App is being served from cache by a service worker.') }, cached() { console.log('Content has been cached for offline use.') @@ -54,6 +51,7 @@ if (process.env.NODE_ENV === 'production') { }, updated() { console.log('New content is available; please refresh.') + location.reload(true) }, offline() { console.log( @@ -64,12 +62,4 @@ if (process.env.NODE_ENV === 'production') { console.error('Error during service worker registration:', error) } }) - let refreshing: any | undefined - navigator.serviceWorker.addEventListener('controllerchange', () => { - if (refreshing) { - return - } - window.location.reload() - refreshing = true - }) }