← back to Jutewallpaper
hydrate sort from localStorage pre-grid-load + noreferrer on Facebook target=_blank
4e2dc091fc9cda98312bba5b54c28137c110702f · 2026-05-25 21:16:05 -0700 · Steve Abrams
- move sort restore into the pre-load view-hydration IIFE so the initial
/api/products fetch fires with the user's saved sort instead of 'newest'
(was racing with the post-DOM sort-select wire-up at line 1049)
- add noreferrer to the Facebook footer link (tab-nabbing + referer-leak
defense; pairs with existing rel=noopener)
Files touched
Diff
commit 4e2dc091fc9cda98312bba5b54c28137c110702f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon May 25 21:16:05 2026 -0700
hydrate sort from localStorage pre-grid-load + noreferrer on Facebook target=_blank
- move sort restore into the pre-load view-hydration IIFE so the initial
/api/products fetch fires with the user's saved sort instead of 'newest'
(was racing with the post-DOM sort-select wire-up at line 1049)
- add noreferrer to the Facebook footer link (tab-nabbing + referer-leak
defense; pairs with existing rel=noopener)
---
public/index.html | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/public/index.html b/public/index.html
index 540a5fc..c090232 100644
--- a/public/index.html
+++ b/public/index.html
@@ -419,7 +419,7 @@ textarea:focus-visible,
<div class="footer-col">
<h4>Social</h4>
- <a class="fb-link" href="https://www.facebook.com/SteveAbramsDesigns.DesignerWallcoverings" target="_blank" rel="noopener">Facebook</a>
+ <a class="fb-link" href="https://www.facebook.com/SteveAbramsDesigns.DesignerWallcoverings" target="_blank" rel="noopener noreferrer">Facebook</a>
</div>
</div>
<div class="footer-bottom">
@@ -497,12 +497,14 @@ const state = { q:'', facet:'all', sort:'newest', view:'grid', page:1, pages:1,
// Touch device = no hover. Drives tap-to-reveal card behavior.
const TOUCH = window.matchMedia('(hover: none)').matches;
const HOSTKEY = location.hostname.replace(/\./g, '_');
-// DW STANDARD: hydrate saved view BEFORE the first grid load.
+// DW STANDARD: hydrate saved view + sort BEFORE the first grid load.
(function(){
try {
const savedView = localStorage.getItem(HOSTKEY + '_view');
if (savedView === 'list' || savedView === 'grid') state.view = savedView;
document.documentElement.dataset.view = state.view;
+ const savedSort = localStorage.getItem(HOSTKEY + '_sort');
+ if (savedSort) state.sort = savedSort;
} catch(e){}
})();
const LABELS = {"all":"All"};
← 9191fe7 wire api-vendor-redact middleware + scrub p.vendor from rail
·
back to Jutewallpaper
·
homepage: add retrowalls-canonical rail-sections (id=rails + 0a68934 →