[object Object]

← back to 1900swallpaper

corner-nav: title-case the brand name even when .ns-name source is lowercase

c5682ae51614b41d8c5b6e8a7458c50c3a25a04f · 2026-05-13 17:42:52 -0700 · SteveStudio2

Files touched

Diff

commit c5682ae51614b41d8c5b6e8a7458c50c3a25a04f
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Wed May 13 17:42:52 2026 -0700

    corner-nav: title-case the brand name even when .ns-name source is lowercase
---
 public/corner-nav.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/public/corner-nav.js b/public/corner-nav.js
index a438b4c..2bda0fc 100644
--- a/public/corner-nav.js
+++ b/public/corner-nav.js
@@ -30,9 +30,13 @@
       .trim()
       .replace(/\b\w/g, function (c) { return c.toUpperCase(); });
   }
-  var BRAND  = (document.querySelector('meta[name="brand"]') || {}).content
-            || (document.querySelector('.ns-name') || {}).textContent
-            || titleCase(STEM);
+  var rawBrand = (document.querySelector('meta[name="brand"]') || {}).content
+              || ((document.querySelector('.ns-name') || {}).textContent || '').trim()
+              || STEM;
+  // Title-case if the source is all-lowercase (the .ns-name spans on DW sites
+  // are intentionally lowercase for typography; the menu panel header wants
+  // proper case so it doesn't read as a slug).
+  var BRAND = (rawBrand === rawBrand.toLowerCase()) ? titleCase(rawBrand) : rawBrand;
 
   var BAG_URL     = CFG.bagUrl     || 'https://designerwallcoverings.com/search?q=' + encodeURIComponent(BRAND);
   var ACCOUNT_URL = CFG.accountUrl || 'https://designerwallcoverings.com/account';

← abfad23 corner-nav: title-case brand display (e.g. corkwallcovering  ·  back to 1900swallpaper  ·  favicon: Mag-7-inspired SVG glyph 731851d →