Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | methods: { | ||||
localStorage.setItem('token', '') | localStorage.setItem('token', '') | ||||
delete axios.defaults.headers.common.Authorization | delete axios.defaults.headers.common.Authorization | ||||
this.$router.push({ name: 'login' }) | this.$router.push({ name: 'login' }) | ||||
}, | }, | ||||
// Display "loading" overlay (to be used by route components) | // Display "loading" overlay (to be used by route components) | ||||
startLoading() { | startLoading() { | ||||
this.isLoading = true | this.isLoading = true | ||||
// Lock the UI with the 'loading...' element | // Lock the UI with the 'loading...' element | ||||
let loading = $('#app > .app-loader').show() | |||||
if (!loading.length) { | |||||
$('#app').append($('<div class="app-loader"><div class="spinner-border" role="status"><span class="sr-only">Loading</span></div></div>')) | $('#app').append($('<div class="app-loader"><div class="spinner-border" role="status"><span class="sr-only">Loading</span></div></div>')) | ||||
} | |||||
}, | }, | ||||
// Hide "loading" overlay | // Hide "loading" overlay | ||||
stopLoading() { | stopLoading() { | ||||
$('#app > .app-loader').fadeOut() | $('#app > .app-loader').fadeOut() | ||||
this.isLoading = false | this.isLoading = false | ||||
}, | }, | ||||
errorPage(code, msg) { | errorPage(code, msg) { | ||||
// Until https://github.com/vuejs/vue-router/issues/977 is implemented | // Until https://github.com/vuejs/vue-router/issues/977 is implemented | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |