forked from MapComplete/MapComplete
Remove empty elements
This commit is contained in:
parent
ea61e17268
commit
40a0e7931d
3 changed files with 23 additions and 15 deletions
|
|
@ -16,7 +16,10 @@ export default class EditableTagRendering extends Toggle {
|
|||
constructor(tags: UIEventSource<any>,
|
||||
configuration: TagRenderingConfig,
|
||||
units: Unit [],
|
||||
editMode = new UIEventSource<boolean>(false)
|
||||
options:{
|
||||
editMode? : UIEventSource<boolean> ,
|
||||
innerElementClasses?: string
|
||||
}
|
||||
) {
|
||||
|
||||
// The tagrendering is hidden if:
|
||||
|
|
@ -27,7 +30,12 @@ export default class EditableTagRendering extends Toggle {
|
|||
(configuration?.condition?.matchesProperties(tags) ?? true))
|
||||
|
||||
super(
|
||||
new Lazy(() => EditableTagRendering.CreateRendering(tags, configuration, units, editMode)),
|
||||
new Lazy(() => {
|
||||
const editMode = options.editMode ?? new UIEventSource<boolean>(false)
|
||||
const rendering = EditableTagRendering.CreateRendering(tags, configuration, units, editMode);
|
||||
rendering.SetClass(options.innerElementClasses)
|
||||
return rendering
|
||||
}),
|
||||
undefined,
|
||||
renderingIsShown
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue