← back to Gracie Internal
Persist gracie viewer sort selection to localStorage
d9e5f8b84cf0f5034450115be5411729b603f9d4 · 2026-07-09 09:52:42 -0700 · Steve
sort onchange only called render() — now saves gracieSort and restores it on
load like the density/imgonly prefs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
Diff
commit d9e5f8b84cf0f5034450115be5411729b603f9d4
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Jul 9 09:52:42 2026 -0700
Persist gracie viewer sort selection to localStorage
sort onchange only called render() — now saves gracieSort and restores it on
load like the density/imgonly prefs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
public/index.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/index.html b/public/index.html
index 765814b..a3eaef1 100644
--- a/public/index.html
+++ b/public/index.html
@@ -200,13 +200,14 @@ function render() {
}
// controls
-document.getElementById('sort').onchange = render;
+document.getElementById('sort').onchange = (e)=> { localStorage.gracieSort = e.target.value; render(); };
document.getElementById('density').oninput = (e)=> { document.documentElement.style.setProperty('--cardmin', e.target.value+'px'); localStorage.gracieDensity = e.target.value; };
document.getElementById('imgonly').onchange = (e)=> { document.body.classList.toggle('imgonly', e.target.checked); localStorage.gracieImgOnly = e.target.checked?'1':''; };
document.getElementById('search').oninput = (e)=> { SEARCH = e.target.value.trim().toLowerCase(); render(); };
// restore prefs
if (localStorage.gracieDensity) { document.getElementById('density').value = localStorage.gracieDensity; document.documentElement.style.setProperty('--cardmin', localStorage.gracieDensity+'px'); }
if (localStorage.gracieImgOnly) { document.getElementById('imgonly').checked = true; document.body.classList.add('imgonly'); }
+if (localStorage.gracieSort) { document.getElementById('sort').value = localStorage.gracieSort; }
boot();
</script>
</body>
← c6011ff initial scaffold: Gracie internal (internal line viewer :100
·
back to Gracie Internal
·
Strip product count from unauthenticated /healthz 88443b8 →