on master help sign in
Merge pull request #165 from matildepark/mobile-page-nav

Remove content nav toggle on non-doc/post content

commitc25981605d8435800c86d5cf58edf9df10bd3566 authorMorgan Sutherland <msutherl@users.noreply.github.com> dateThu 8 Aug 2019, 16:17 (7 years ago) parent3f1c129b8fd5f6
2 files changed+13
sass/_responsive.scss+3 static/scripts.js+10
sass/_responsive.scss+3
@@ -19,6 +19,9 @@
1919 }
2020 .content-nav-icon {
2121 display: block;
22+ &.none {
23+ display: none;
24+ }
2225 }
2326 .content, .content-spacer {
2427 flex-basis: 90%;
static/scripts.js+10
@@ -7,6 +7,16 @@ if (toggleMainNav !== null) {
77}
88
99var toggleContentNav = document.getElementById('js-content-nav-toggle');
10+
11+// Only show the content nav for docs or posts
12+let navEnabledSections = ['docs', 'posts']
13+let showNav = false
14+for (let section of navEnabledSections) {
15+ window.location.href.includes(section) ? showNav = true : null
16+}
17+showNav ? null : toggleContentNav.classList.add('none')
18+
19+
1020if (toggleContentNav !== null) {
1121 toggleContentNav.onclick = function() {
1222 document.body.classList.toggle('has-active-content-nav');