diff --git a/view/vue-config.js b/view/vue-config.js index 2eaf861..aeab430 100644 --- a/view/vue-config.js +++ b/view/vue-config.js @@ -49,6 +49,20 @@ if( /^\/(\w+)(?:\/?.*)$/.test(window.gstore.data.URI) ){ // Functions window.gstore.add('func', { + nav: function(router, uri){ + + // {1} Update view (vue-router) // + router.push('/'+uri); + + // {2} Activate current menu_item // + window.gstore.data.menu_item_active = uri; + + // {3} Manage notifications // + for( var notif of window.gstore.data.notif ) + if( notif.link == uri ) // if notif links to current page + notif.count = 0; + + }, toggleMenuSize: function(){ window.gstore.data.min_menu=!window.gstore.data.min_menu; }, sendMessage: function(msg){ /* (1) Send message to WebSocket */ diff --git a/view/vue/header.vue b/view/vue/header.vue index 745135d..b3ea3a9 100644 --- a/view/vue/header.vue +++ b/view/vue/header.vue @@ -12,7 +12,7 @@