Fix layer toggling
This commit is contained in:
parent
e2ae83536e
commit
662b752a39
4 changed files with 10 additions and 14 deletions
|
@ -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);
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue