Remove empty elements

This commit is contained in:
Pieter Vander Vennet 2021-10-28 00:53:09 +02:00
parent ea61e17268
commit 40a0e7931d
3 changed files with 23 additions and 15 deletions

View file

@ -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
)