From e64c0a034e2f28376026fc236319e64022f27cc4 Mon Sep 17 00:00:00 2001 From: Joel Kleppinger Date: Thu, 5 Oct 2017 06:23:21 -0500 Subject: [PATCH] Mobile sidebar link click should close the sidebar When a mobile user clicks a link in the sidebar, it should close that sidebar for mobile users. The reason is that the "default" mobile experience ought to be menu-less or content will flow off the screen. --- Vue_Full_Project/src/components/SidebarNavLink.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Vue_Full_Project/src/components/SidebarNavLink.vue b/Vue_Full_Project/src/components/SidebarNavLink.vue index 8bc5fcef..445bcac5 100644 --- a/Vue_Full_Project/src/components/SidebarNavLink.vue +++ b/Vue_Full_Project/src/components/SidebarNavLink.vue @@ -7,8 +7,10 @@
- {{name}} - {{badge.text}} + + {{name}} + {{badge.text}} +
@@ -53,6 +55,13 @@ linkExternal () { return isExternal(this.url) } + }, + methods: { + hideMobile () { + if (document.body.classList.contains('sidebar-mobile-show')) { + document.body.classList.toggle('sidebar-mobile-show') + } + } } }