forked from MapComplete/MapComplete
Optimize rendering
This commit is contained in:
parent
8babafaadb
commit
a721d3137a
21 changed files with 361 additions and 362 deletions
26
UI/Popup/SaveButton.ts
Normal file
26
UI/Popup/SaveButton.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
import {UIElement} from "../UIElement";
|
||||
import Translations from "../i18n/Translations";
|
||||
|
||||
export class SaveButton extends UIElement {
|
||||
private _value: UIEventSource<any>;
|
||||
|
||||
constructor(value: UIEventSource<any>) {
|
||||
super(value);
|
||||
if(value === undefined){
|
||||
throw "No event source for savebutton, something is wrong"
|
||||
}
|
||||
this._value = value;
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
if (this._value.data === undefined ||
|
||||
this._value.data === null
|
||||
|| this._value.data === ""
|
||||
) {
|
||||
return "<span class='save-non-active'>"+Translations.t.general.save.Render()+"</span>"
|
||||
}
|
||||
return "<span class='save'>"+Translations.t.general.save.Render()+"</span>";
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue