ics help button

This commit is contained in:
Kenneth SOARES
2025-05-11 14:33:04 +02:00
parent ac0c2c9880
commit 5ca1f03d9d
3 changed files with 33 additions and 1 deletions

View File

@ -17,11 +17,12 @@ import {
@registerComponent("ics-calendar")
export class IcsCalendar extends inheritHtmlElement("div") {
static observedAttributes = ["locale", "can_moderate", "can_delete"];
static observedAttributes = ["locale", "can_moderate", "can_delete", "ics-help-url"];
private calendar: Calendar;
private locale = "en";
private canModerate = false;
private canDelete = false;
private helpUrl = "";
attributeChangedCallback(name: string, _oldValue?: string, newValue?: string) {
if (name === "locale") {
@ -33,6 +34,10 @@ export class IcsCalendar extends inheritHtmlElement("div") {
if (name === "can_delete") {
this.canDelete = newValue.toLowerCase() === "true";
}
if (name === "ics-help-url") {
this.helpUrl = newValue;
}
}
isMobile() {
@ -335,6 +340,14 @@ export class IcsCalendar extends inheritHtmlElement("div") {
}, 1500);
},
},
helpButton: {
text: "?",
click: () => {
if (this.helpUrl) {
window.open(this.helpUrl, "_blank");
}
},
},
},
height: "auto",
locale: this.locale,