Spaces:
Running
Running
Keep filters open on wide layouts
Browse files- static/app.js +7 -1
static/app.js
CHANGED
|
@@ -796,8 +796,14 @@
|
|
| 796 |
if (Telemetry.gpc) $("#gpc-note").hidden = false;
|
| 797 |
opt.addEventListener("change", () => Telemetry.setOptOut(opt.checked));
|
| 798 |
// On phones the rail sits above the results: keep only memory and context open.
|
|
|
|
|
|
|
|
|
|
| 799 |
const hasFilters = /[?&](family|size|quant|priority)=/.test(location.search);
|
| 800 |
-
|
|
|
|
|
|
|
|
|
|
| 801 |
updateBenchCmd();
|
| 802 |
loadMeta()
|
| 803 |
.then(() => explore())
|
|
|
|
| 796 |
if (Telemetry.gpc) $("#gpc-note").hidden = false;
|
| 797 |
opt.addEventListener("change", () => Telemetry.setOptOut(opt.checked));
|
| 798 |
// On phones the rail sits above the results: keep only memory and context open.
|
| 799 |
+
// Wide layouts hide the toggle, so the section must always be open there
|
| 800 |
+
// (embedded iframes can start narrow and widen a moment later).
|
| 801 |
+
const narrow = window.matchMedia("(max-width: 900px)");
|
| 802 |
const hasFilters = /[?&](family|size|quant|priority)=/.test(location.search);
|
| 803 |
+
const syncFilters = () => { if (!narrow.matches) $("#more-filters").open = true; };
|
| 804 |
+
if (narrow.matches && window.innerWidth > 0 && !hasFilters) $("#more-filters").open = false;
|
| 805 |
+
narrow.addEventListener("change", syncFilters);
|
| 806 |
+
window.addEventListener("resize", syncFilters);
|
| 807 |
updateBenchCmd();
|
| 808 |
loadMeta()
|
| 809 |
.then(() => explore())
|