]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - app.js
Added Hamburger Menu for small screens per Bulma spec.
[github/bastienwirtz/homer.git] / app.js
diff --git a/app.js b/app.js
index 0cd75b53724263cf7c0d3d5f1fb959038db226a2..a2960690a88072846cde77e93179307251c5f0ee 100644 (file)
--- 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;
@@ -25,7 +26,7 @@ const app = new Vue({
         }
 
         // 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 +81,9 @@ const app = new Vue({
             this.vlayout = !this.vlayout;
             localStorage.vlayout = this.vlayout;
         },
+        toggleMenu: function() {
+            this.showMenu = !this.showMenu;
+        }
     }
 });