Implemented phase 1 for the POC prototype in the Website service.
This commit is contained in:
1 parent
6d7ab4bcba
commit
ea89ea892a
37 files changed
+4173
-43
No files matched your search
@@ -0,0 +1,23 @@
|
||||
// CCN — shared script. Every screen works without it; it only removes a click here and there.
|
||||
|
||||
document.documentElement.classList.add("js");
|
||||
|
||||
// Selects marked `data-autosubmit` submit their form on change.
|
||||
for (const select of document.querySelectorAll("select[data-autosubmit]")) {
|
||||
select.addEventListener("change", () => select.form?.requestSubmit());
|
||||
}
|
||||
|
||||
// The filter rail is a disclosure, open on desktop. Browsers without `::details-content` need it opened here.
|
||||
const filters = document.querySelector("details.filters");
|
||||
const desktop = window.matchMedia("(min-width: 1024px)");
|
||||
|
||||
if (filters) {
|
||||
const sync = () => {
|
||||
if (desktop.matches) {
|
||||
filters.open = true;
|
||||
}
|
||||
};
|
||||
|
||||
sync();
|
||||
desktop.addEventListener("change", sync);
|
||||
}
|
||||
Reference in new issue
Block a user