More refactoring, stuff kindoff works

This commit is contained in:
Pieter Vander Vennet 2021-06-12 02:58:32 +02:00
parent 62f471df1e
commit 3943100e54
52 changed files with 635 additions and 1010 deletions

View file

@ -6,18 +6,18 @@ import {UIEventSource} from "../../Logic/UIEventSource";
export default class Link extends BaseUIElement {
private readonly _element: HTMLElement;
constructor(embeddedShow: BaseUIElement | string, target: string | UIEventSource<string>, newTab: boolean = false) {
constructor(embeddedShow: BaseUIElement | string, href: string | UIEventSource<string>, newTab: boolean = false) {
super();
const _embeddedShow = Translations.W(embeddedShow);
const el = document.createElement("a")
if(typeof target === "string"){
el.href = target
if(typeof href === "string"){
el.href = href
}else{
target.addCallbackAndRun(target => {
el.target = target;
href.addCallbackAndRun(href => {
el.href = href;
})
}
if (newTab) {