« get me outta code hell

fix nav wrapping issues at small widths - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/upd8.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-06-21 23:13:05 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-06-21 23:13:05 -0300
commit0a717fec1c1557d40f14d1715f72960d2255cc44 (patch)
treec0b354d4bea4babb3b978e76142f96ab7b398207 /src/upd8.js
parent87588c9305fd76dd75af8eae7a2170f81eff9474 (diff)
fix nav wrapping issues at small widths
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-xsrc/upd8.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/upd8.js b/src/upd8.js
index d1077fbb..d9bca28f 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -1013,12 +1013,17 @@ writePage.html = (pageInfo, {
     const navHTML = html.tag('nav', {
         [html.onlyIfContent]: true,
         id: 'header',
-        class: nav.classes
+        class: [
+            ...nav.classes,
+            links.length && 'nav-has-main-links',
+            nav.content && 'nav-has-content',
+            nav.bottomRowContent && 'nav-has-bottom-row',
+        ],
     }, [
         links.length && html.tag('div',
             {class: ['nav-main-links', ...nav.linkContainerClasses]},
             navLinkParts),
-        html.tag('div', {class: 'nav-content'}, nav.content),
+        nav.content && html.tag('div', {class: 'nav-content'}, nav.content),
         nav.bottomRowContent && html.tag('div', {class: 'nav-bottom-row'}, nav.bottomRowContent),
     ]);