forked from MapComplete/MapComplete
Performance hacks
This commit is contained in:
parent
686fb29ed3
commit
7090a5ceb8
15 changed files with 167 additions and 93 deletions
|
@ -8,10 +8,19 @@ export class VariableUiElement extends BaseUIElement {
|
|||
super();
|
||||
this._contents = contents;
|
||||
}
|
||||
|
||||
Destroy() {
|
||||
super.Destroy();
|
||||
this.isDestroyed = true;
|
||||
}
|
||||
|
||||
protected InnerConstructElement(): HTMLElement {
|
||||
const el = document.createElement("span");
|
||||
const self = this;
|
||||
this._contents.addCallbackAndRun((contents) => {
|
||||
if(self.isDestroyed){
|
||||
return true;
|
||||
}
|
||||
while (el.firstChild) {
|
||||
el.removeChild(el.lastChild);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue