diff options
Diffstat (limited to 'public/static')
| -rw-r--r-- | public/static/refs.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/public/static/refs.js b/public/static/refs.js index f3e07e8..1035593 100644 --- a/public/static/refs.js +++ b/public/static/refs.js @@ -52,10 +52,20 @@ document.addEventListener("DOMContentLoaded", () => { .then((html) => { if (html.trim()) { placeholder.outerHTML = html; + relocate(); } else { placeholder.remove(); } }) .catch(() => placeholder.remove()); } + + // A fragment may carry a node that belongs elsewhere on the page, where an + // empty element of that id holds its spot: the sidebar's latest release + // reads as part of the release count, far from the languages it arrives with. + function relocate() { + for (const node of document.querySelectorAll("[data-target]")) { + document.getElementById(node.dataset.target)?.replaceWith(node); + } + } }); |
