[feature/frontend] Hide "engagement" stats, edits, and other info under a little drop down to unclutter status info bar (#4021)

* dick about with stats a bit

* more dicking abuot

* lil tweaks

* more about-dicking

* weee

* comments

* fixie uppie
This commit is contained in:
tobi
2025-04-18 17:36:26 +02:00
committed by GitHub
parent d694666436
commit 2fce027808
14 changed files with 453 additions and 143 deletions

View File

@ -338,3 +338,25 @@ Array.from(document.getElementsByTagName('time')).forEach(timeTag => {
timeTag.textContent = dateTimeFormat.format(date);
}
});
// When clicking anywhere that's not an open
// stats-info-more-content details dropdown,
// close that open dropdown.
document.body.addEventListener("click", (e) => {
const openStats = document.querySelector("details.stats-more-info[open]");
if (!openStats) {
// No open stats
// details element.
return;
}
if (openStats.contains(e.target)) {
// Click is within stats
// element, leave it alone.
return;
}
// Click was outside of
// stats elements, close it.
openStats.removeAttribute("open");
});