Fix layer toggling

This commit is contained in:
Pieter Vander Vennet 2020-07-22 12:17:06 +02:00
parent e2ae83536e
commit 662b752a39
4 changed files with 10 additions and 14 deletions

View file

@ -12,14 +12,14 @@ export class CheckBox extends UIElement{
private readonly _showDisabled: string|UIElement;
constructor(showEnabled: string|UIElement, showDisabled: string|UIElement, data: UIEventSource<boolean> = undefined) {
super(data);
this._data = data??new UIEventSource(false);
super(undefined);
this._data = data ?? new UIEventSource<boolean>(false);
this.ListenTo(this._data);
this._showEnabled = showEnabled;
this._showDisabled = showDisabled;
const self = this;
this.onClick(() => {
self._data.setData(!self._data.data);
})
}