mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Adapt calendar to new tooltip library
This commit is contained in:
@ -320,13 +320,13 @@ export class IcsCalendar extends inheritHtmlElement("div") {
|
||||
const button = event.target as HTMLButtonElement;
|
||||
button.classList.add("text-copy");
|
||||
if (!button.hasAttribute("position")) {
|
||||
button.setAttribute("tooltip", gettext("Link copied"));
|
||||
button.setAttribute("position", "top");
|
||||
button.setAttribute("no-hover", "");
|
||||
}
|
||||
if (button.classList.contains("text-copied")) {
|
||||
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),
|
||||
@ -337,6 +337,8 @@ 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);
|
||||
},
|
||||
},
|
||||
|
@ -1,4 +1,5 @@
|
||||
@import "core/static/core/colors";
|
||||
@import "core/static/core/tooltips";
|
||||
|
||||
|
||||
:root {
|
||||
@ -117,11 +118,6 @@ ics-calendar {
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
button.text-copied[tooltip]::before {
|
||||
opacity: 0;
|
||||
transition: opacity 500ms ease-out;
|
||||
}
|
||||
|
||||
.fc .fc-helpButton-button {
|
||||
border-radius: 70%;
|
||||
padding-left: 0.5rem;
|
||||
@ -137,4 +133,4 @@ ics-calendar {
|
||||
.fc .fc-helpButton-button:hover {
|
||||
background-color: rgba(20, 20, 20, 0.6);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user