on master help sign in
Merge pull request #165 from matildepark/mobile-page-nav
c259816Morgan Sutherland
sass/_responsive.scss+3
@@ -19,6 +19,9 @@
19 }
19 }
20 .content-nav-icon {
20 .content-nav-icon {
21 display: block;
21 display: block;
22+ &.none {
23+ display: none;
24+ }
22 }
25 }
23 .content, .content-spacer {
26 .content, .content-spacer {
24 flex-basis: 90%;
27 flex-basis: 90%;
static/scripts.js+10
@@ -7,6 +7,16 @@ if (toggleMainNav !== null) {
7}
7}
8
8
9var toggleContentNav = document.getElementById('js-content-nav-toggle');
9var 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+
10if (toggleContentNav !== null) {
20if (toggleContentNav !== null) {
11 toggleContentNav.onclick = function() {
21 toggleContentNav.onclick = function() {
12 document.body.classList.toggle('has-active-content-nav');
22 document.body.classList.toggle('has-active-content-nav');