← back to Linenwallpaper
dw-header: hide ANY pre-existing <header> (not just ns-header); title-case bare-slug names
e89c1245c1acf7a433f78f10a0e2341688d4f741 · 2026-06-01 15:47:45 -0700 · Steve Abrams
Files touched
M public/dw-header.jsM public/index.html
Diff
commit e89c1245c1acf7a433f78f10a0e2341688d4f741
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jun 1 15:47:45 2026 -0700
dw-header: hide ANY pre-existing <header> (not just ns-header); title-case bare-slug names
---
public/dw-header.js | 9 +++++----
public/index.html | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/public/dw-header.js b/public/dw-header.js
index 0f10a0b..d02a7b6 100644
--- a/public/dw-header.js
+++ b/public/dw-header.js
@@ -98,12 +98,13 @@
'<nav class="dwh-drawer" id="dwhNavDrawer" aria-label="Primary">' + linksHTML(NAV) + '</nav>' +
(isAdmin ? '<nav class="dwh-drawer dwh-admin-drawer" id="dwhAdminDrawer" aria-label="Admin tools"><div class="dwh-head">Admin tools</div>' + linksHTML(ADMIN) + '<button type="button" data-act="logout">Sign out admin</button></nav>' : '');
- // remove any pre-existing inline header so we don't double up
- var old = document.querySelector('header.ns-header, header.dwh:not(:first-of-type)');
- if (old && old.className.indexOf('dwh') === -1) old.style.display = 'none';
-
document.body.insertBefore(header, document.body.firstChild);
+ // hide ANY pre-existing site header (ns-header, .header, etc.) so we never double up
+ document.querySelectorAll('header').forEach(function (h) {
+ if (h !== header && h.className.indexOf('dwh') === -1) h.style.display = 'none';
+ });
+
// ---- behaviour ----
function drawer(id) { return document.getElementById(id); }
function close(navId, btnId) { var d = drawer(navId), b = document.getElementById(btnId); if (d) d.classList.remove('open'); if (b) b.setAttribute('aria-expanded', 'false'); }
diff --git a/public/index.html b/public/index.html
index 096ed57..a96ee16 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1407,7 +1407,7 @@ async function renderRailSections(){
data-mode="retail"
defer onerror="this.remove()"></script>
-<script>window.DwHeaderConfig={siteName:"linenwallpaper",accent:"#9B7B4F",navLinks:[{name:'Home',url:'/'},{name:'Collections',url:'#shop'},{name:'About',url:'/about'},{name:'Care',url:'/care.html'},{name:'History',url:'/history.html'}],adminLinks:[{name:'Shopify admin',url:'https://admin.shopify.com',external:true},{name:'Edit hero',url:'#'},{name:'Analytics',url:'#'}]};</script>
+<script>window.DwHeaderConfig={siteName:"Linen Wallpaper",accent:"#9B7B4F",navLinks:[{name:'Home',url:'/'},{name:'Collections',url:'#shop'},{name:'About',url:'/about'},{name:'Care',url:'/care.html'},{name:'History',url:'/history.html'}],adminLinks:[{name:'Shopify admin',url:'https://admin.shopify.com',external:true},{name:'Edit hero',url:'#'},{name:'Analytics',url:'#'}]};</script>
<script src="/dw-header.js" defer></script>
</body>
</html>
← 55c35a8 FIX: dw-header was injected inside a doc-comment (never ran)
·
back to Linenwallpaper
·
fleet rebuild: dw-header (hamburgers UL + centered name) + u a2a5414 →