forked from MapComplete/MapComplete
Add custom theme for advanced users
This commit is contained in:
parent
004eead4ee
commit
9c42839f01
44 changed files with 635 additions and 326 deletions
|
@ -3,10 +3,12 @@ import Translations from "../i18n/Translations";
|
|||
|
||||
export default class Combine extends UIElement {
|
||||
private uiElements: (string | UIElement)[];
|
||||
private className: string = undefined;
|
||||
private clas: string = undefined;
|
||||
|
||||
constructor(uiElements: (string | UIElement)[]) {
|
||||
constructor(uiElements: (string | UIElement)[], className: string = undefined) {
|
||||
super(undefined);
|
||||
this.className = className;
|
||||
this.uiElements = uiElements;
|
||||
}
|
||||
|
||||
|
@ -19,6 +21,10 @@ export default class Combine extends UIElement {
|
|||
elements += element;
|
||||
}
|
||||
}
|
||||
if(this.className !== undefined){
|
||||
elements = `<span class='${this.className}'>${elements}</span>`;
|
||||
}
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
||||
|
|
20
UI/Base/Image.ts
Normal file
20
UI/Base/Image.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import {UIElement} from "../UIElement";
|
||||
|
||||
|
||||
export class Image extends UIElement{
|
||||
private src: string;
|
||||
private style: string = "";
|
||||
constructor(src: string, style: string = "") {
|
||||
super(undefined);
|
||||
this.style = style;
|
||||
this.src = src;
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
if(this.src === undefined){
|
||||
return "";
|
||||
}
|
||||
return `<img src='${this.src}' style='${this.style}'>`;
|
||||
}
|
||||
|
||||
}
|
|
@ -27,8 +27,10 @@ export class TabbedComponent extends UIElement {
|
|||
for (let i = 0; i < this.headers.length; i++) {
|
||||
let header = this.headers[i];
|
||||
|
||||
headerBar += `<div class=\'tab-single-header ${i == this._source.data ? 'tab-active' : 'tab-non-active'}\'>` +
|
||||
header.Render() + "</div>"
|
||||
if (!this.content[i].IsEmpty()) {
|
||||
headerBar += `<div class=\'tab-single-header ${i == this._source.data ? 'tab-active' : 'tab-non-active'}\'>` +
|
||||
header.Render() + "</div>"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue