forked from MapComplete/MapComplete
More refactoring and fixes
This commit is contained in:
parent
d7004cd3dc
commit
9cc721abad
37 changed files with 519 additions and 632 deletions
|
@ -1,17 +1,11 @@
|
|||
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||
import {UIElement} from "../UIElement";
|
||||
import Translations from "../i18n/Translations";
|
||||
import {OsmConnection} from "../../Logic/Osm/OsmConnection";
|
||||
import BaseUIElement from "../BaseUIElement";
|
||||
import Toggle from "../Input/Toggle";
|
||||
|
||||
export class SaveButton extends UIElement {
|
||||
|
||||
|
||||
private readonly _element: BaseUIElement;
|
||||
export class SaveButton extends Toggle {
|
||||
|
||||
constructor(value: UIEventSource<any>, osmConnection: OsmConnection) {
|
||||
super(value);
|
||||
if (value === undefined) {
|
||||
throw "No event source for savebutton, something is wrong"
|
||||
}
|
||||
|
@ -31,7 +25,7 @@ export class SaveButton extends UIElement {
|
|||
saveDisabled,
|
||||
isSaveable
|
||||
)
|
||||
this._element = new Toggle(
|
||||
super(
|
||||
save
|
||||
, pleaseLogin,
|
||||
osmConnection?.userDetails?.map(userDetails => userDetails.loggedIn) ?? new UIEventSource<any>(false)
|
||||
|
@ -39,9 +33,4 @@ export class SaveButton extends UIElement {
|
|||
|
||||
}
|
||||
|
||||
InnerRender(): BaseUIElement {
|
||||
return this._element
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue