mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
ics help button
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user