﻿var app = new Vue({
    el: '#app',
    mixins: [adminMixin],
    data: () => ({
        drawer: null,
        active: true,
        snackbar: {
            show: false,
            text: '',
            color: '',
        },
    }),
    computed: {
        tok: function () {
            return document.querySelector('input[name="__RequestVerificationToken"][type="hidden"]').value;
        },
        headers() {
            return { headers: { 'XSRF-TOKEN': this.tok } };
        },
    },
    mounted() {
        var url = window.location.pathname;
        this.adminNavs.forEach(function (nav) {
            nav.active = nav.url === url;
        });
    },
    methods: {
        logout: function () {
            console.log('logout');
            axios.post('/account/logout', null, this.headers)
                .then(function (response) {
                    window.location = '/';
                })
                .catch(function (error) {
                    console.log(error);
                });
        },
        toast(text, color = 'silver') {
            this.snackbar.show = true;
            this.snackbar.text = text;
            this.snackbar.color = color;
        },
        toastError(text) {
            this.snackbar.show = true;
            this.snackbar.text = text;
            this.snackbar.color = 'red';
        },
    }
});
@@ -101,30 +101,8 @@
 ll,%0A
-        active: true,%0A
     
@@ -478,24 +478,181 @@
 mounted() %7B%0A
+        this.initActiveNav();%0A    %7D,%0A    methods: %7B%0A        /**%0A         * Make the current admin side nav active.%0A         */%0A        initActiveNav() %7B%0A    
         var 
@@ -683,16 +683,20 @@
 thname;%0A
+    
         
@@ -747,16 +747,20 @@
         
+    
 nav.acti
@@ -768,25 +768,37 @@
 e = 
-nav.url === url;%0A
+url.startsWith(nav.url);%0A    
     
@@ -809,33 +809,22 @@
 %7D);%0A    
-%7D,%0A
     
-methods: %7B
+%7D,
 %0A       

Update admin side nav active logic #113