Stories: the button sits left of elements marked data-stories-corner

The corner controls are the ACTIVE STYLE readout and any element marked
with data-stories-corner, looked for again for 20 s after Stories mounts,
in place of an element id this app never has.
This commit is contained in:
Sameh Khamis committed 2026-11-16 14:14:27 -08:00
1 parent 78b8d8dc78
commit 9e6207d7f2
4 files changed
+55 -14

No files matched your search

+16 -2
View File
@@ -30,10 +30,24 @@ export function creditPlacement({ map, feed, width, height }) {
};
}
/**
* The controls in GEV's top-right corner: the ACTIVE STYLE readout
* (`#style-indicator`) and any element marked with `data-stories-corner`.
* @param {Document|Element} root Where to look.
* @returns {Element[]}
*/
export function cornerControls(root) {
return [
root.querySelector('#style-indicator'),
...root.querySelectorAll('[data-stories-corner]'),
].filter(Boolean);
}
/**
* Where the Stories button sits: just left of the leftmost visible control
* in GEV's top-right corner — the ACTIVE STYLE readout, or an element placed
* in that corner (with or beside the readout) — top-aligned with it.
* in GEV's top-right corner — the ACTIVE STYLE readout, or an element marked
* with `data-stories-corner` (with or beside the readout) — top-aligned with
* it.
* Where none of those shows (GEV's phone layout, whose top row of icon
* buttons spans the corner), it goes icon-only just under the right-hand
* column of corner actions, aligned with its right edge.