forked from MapComplete/MapComplete
Generate assets as SVG
This commit is contained in:
parent
3502563f92
commit
ca858b7ed5
49 changed files with 3551 additions and 91 deletions
23
UI/Base/Link.ts
Normal file
23
UI/Base/Link.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import {UIElement} from "../UIElement";
|
||||
|
||||
|
||||
export default class Link extends UIElement {
|
||||
private readonly _embeddedShow: UIElement;
|
||||
private readonly _target: string;
|
||||
private readonly _newTab: string;
|
||||
|
||||
constructor(embeddedShow: UIElement, target: string, newTab: boolean = false) {
|
||||
super();
|
||||
this._embeddedShow = embeddedShow;
|
||||
this._target = target;
|
||||
this._newTab = "";
|
||||
if (newTab) {
|
||||
this._newTab = "target='_blank'"
|
||||
}
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
return `<a href="${this._target}" ${this._newTab}>${this._embeddedShow.Render()}</a>`;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue