mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-08 07:51:10 -06:00
lil tweaks
This commit is contained in:
parent
6ef4cc36b2
commit
5291146f8a
4 changed files with 24 additions and 14 deletions
|
|
@ -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");
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue