Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | const app = new Vue({ | ||||
components: { | components: { | ||||
AppComponent, | AppComponent, | ||||
MenuComponent, | MenuComponent, | ||||
}, | }, | ||||
store, | store, | ||||
router: window.router, | router: window.router, | ||||
data() { | data() { | ||||
return { | return { | ||||
isAdmin: window.isAdmin | isAdmin: window.isAdmin, | ||||
appName: window.config['app.name'], | |||||
appUrl: window.config['app.url'], | |||||
themeDir: '/themes/' + window.config['app.theme'] | |||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
// Clear (bootstrap) form validation state | // Clear (bootstrap) form validation state | ||||
clearFormValidation(form) { | clearFormValidation(form) { | ||||
$(form).find('.is-invalid').removeClass('is-invalid') | $(form).find('.is-invalid').removeClass('is-invalid') | ||||
$(form).find('.invalid-feedback').remove() | $(form).find('.invalid-feedback').remove() | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | methods: { | ||||
delete axios.defaults.headers.common.Authorization | delete axios.defaults.headers.common.Authorization | ||||
if (redirect !== false) { | if (redirect !== false) { | ||||
this.$router.push({ name: 'login' }) | this.$router.push({ name: 'login' }) | ||||
} | } | ||||
clearTimeout(this.refreshTimeout) | clearTimeout(this.refreshTimeout) | ||||
}, | }, | ||||
logo(mode) { | |||||
let src = this.appUrl + this.themeDir + '/images/logo_' + (mode || 'header') + '.png' | |||||
return `<img src="${src}" alt="${this.appName}">` | |||||
}, | |||||
// Display "loading" overlay inside of the specified element | // Display "loading" overlay inside of the specified element | ||||
addLoader(elem) { | addLoader(elem) { | ||||
$(elem).css({position: 'relative'}).append($(loader).addClass('small')) | $(elem).css({position: 'relative'}).append($(loader).addClass('small')) | ||||
}, | }, | ||||
// Remove loader element added in addLoader() | // Remove loader element added in addLoader() | ||||
removeLoader(elem) { | removeLoader(elem) { | ||||
$(elem).find('.app-loader').remove() | $(elem).find('.app-loader').remove() | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |