Merge branch 'master' into develop

This commit is contained in:
Pieter Vander Vennet 2023-09-21 02:32:15 +02:00
commit 8d1ae657fc
28 changed files with 693 additions and 196 deletions

View file

@ -1,18 +1,22 @@
import Translations from "../i18n/Translations"
import BaseUIElement from "../BaseUIElement"
import { Store } from "../../Logic/UIEventSource"
import { Utils } from "../../Utils"
export default class Link extends BaseUIElement {
private readonly _href: string | Store<string>
private readonly _embeddedShow: BaseUIElement
private readonly _newTab: boolean
private readonly _download: string
constructor(
embeddedShow: BaseUIElement | string,
href: string | Store<string>,
newTab: boolean = false
newTab: boolean = false,
download: string = undefined
) {
super()
this._download = download
this._embeddedShow = Translations.W(embeddedShow)
this._href = href
this._newTab = newTab
@ -58,6 +62,9 @@ export default class Link extends BaseUIElement {
if (this._newTab) {
el.target = "_blank"
}
if (this._download) {
el.download = this._download
}
el.appendChild(embeddedShow)
return el
}