mirror of
https://github.com/ae-utbm/sith.git
synced 2025-05-16 14:34:04 +00:00
Fix tooltip not appearing/disapearing when attribute is removed
This commit is contained in:
parent
d1e5c93a08
commit
3a5bff8810
@ -327,7 +327,6 @@ export class IcsCalendar extends inheritHtmlElement("div") {
|
||||
button.classList.remove("text-copied");
|
||||
}
|
||||
button.setAttribute("tooltip", gettext("Link copied"));
|
||||
button.dispatchEvent(new Event("mouseover", { bubbles: true }));
|
||||
navigator.clipboard.writeText(
|
||||
new URL(
|
||||
await makeUrl(calendarCalendarInternal),
|
||||
@ -339,7 +338,6 @@ export class IcsCalendar extends inheritHtmlElement("div") {
|
||||
button.classList.remove("text-copied");
|
||||
button.classList.add("text-copied");
|
||||
button.classList.remove("text-copy");
|
||||
button.dispatchEvent(new Event("mouseout", { bubbles: true }));
|
||||
button.removeAttribute("tooltip");
|
||||
}, 1500);
|
||||
},
|
||||
|
@ -136,6 +136,13 @@ new MutationObserver((mutations: MutationRecord[]) => {
|
||||
if (target.hasAttribute("tooltip")) {
|
||||
target.addEventListener("mouseover", tooltipMouseover);
|
||||
target.addEventListener("mouseout", tooltipMouseout);
|
||||
if (target.matches(":hover")) {
|
||||
target.dispatchEvent(new Event("mouseover", { bubbles: true }));
|
||||
}
|
||||
} else if (tooltips.has(target)) {
|
||||
// Remove corresponding tooltip
|
||||
tooltips.get(target).remove();
|
||||
tooltips.delete(target);
|
||||
}
|
||||
}
|
||||
}).observe(document.body, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user