X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app.js;h=6c8307436749b5a33e039aafefc5aaed994b6805;hb=2cf93f388130134d8ff9cf1af7535e21cafc207f;hp=6c2ba9078ef73da8214034e360530a33e7a3a55c;hpb=2e7bedd13e0ce409e5bfa45095a9154463257870;p=github%2Fbastienwirtz%2Fhomer.git diff --git a/app.js b/app.js index 6c2ba90..6c83074 100644 --- a/app.js +++ b/app.js @@ -5,7 +5,8 @@ const app = new Vue({ offline: false, filter: '', vlayout: true, - isDark: null + isDark: null, + showMenu: false }, created: async function () { let that = this; @@ -20,12 +21,13 @@ const app = new Vue({ this.checkOffline(); try { this.config = await this.getConfig(); + document.title = this.config.title + ' | Homer'; } catch (error) { this.offline = true; } // Look for a new message if an endpoint is provided. - if (this.config.message.url) { + if (this.config.message && this.config.message.url) { this.getMessage(this.config.message.url).then(function(message){ // keep the original config value if no value is provided by the endpoint for (const prop of ['title','style','content']) { @@ -80,6 +82,9 @@ const app = new Vue({ this.vlayout = !this.vlayout; localStorage.vlayout = this.vlayout; }, + toggleMenu: function() { + this.showMenu = !this.showMenu; + } } }); @@ -87,7 +92,7 @@ Vue.component('service', { props: ['item'], template: `
- +