Fix chrome styling bug

This commit is contained in:
Pieter Vander Vennet 2021-07-16 02:13:41 +02:00
parent 3bcd255311
commit d0293fb232
2 changed files with 20 additions and 20 deletions

View file

@ -36,7 +36,7 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
.SetClass("break-words font-bold sm:p-0.5 md:p-1 sm:p-1.5 md:p-2"); .SetClass("break-words font-bold sm:p-0.5 md:p-1 sm:p-1.5 md:p-2");
const titleIcons = new Combine( const titleIcons = new Combine(
layerConfig.titleIcons.map(icon => new TagRenderingAnswer(tags, icon, layerConfig.titleIcons.map(icon => new TagRenderingAnswer(tags, icon,
"block w-8 h-8 align-baseline box-content sm:p-0.5") "block w-8 h-8 align-baseline box-content sm:p-0.5", "width: 2rem;")
)) ))
.SetClass("flex flex-row flex-wrap pt-0.5 sm:pt-1 items-center mr-2") .SetClass("flex flex-row flex-wrap pt-0.5 sm:pt-1 items-center mr-2")

View file

@ -16,31 +16,31 @@ export default class TagRenderingAnswer extends VariableUiElement {
throw "Trying to generate a tagRenderingAnswer without configuration..." throw "Trying to generate a tagRenderingAnswer without configuration..."
} }
super(tagsSource.map(tags => { super(tagsSource.map(tags => {
if(tags === undefined){ if (tags === undefined) {
return undefined; return undefined;
} }
if(configuration.condition){ if (configuration.condition) {
if(!configuration.condition.matchesProperties(tags)){ if (!configuration.condition.matchesProperties(tags)) {
return undefined; return undefined;
} }
} }
const trs = Utils.NoNull(configuration.GetRenderValues(tags)); const trs = Utils.NoNull(configuration.GetRenderValues(tags));
if(trs.length === 0){ if (trs.length === 0) {
return undefined; return undefined;
} }
const valuesToRender: BaseUIElement[] = trs.map(tr => new SubstitutedTranslation(tr, tagsSource)) const valuesToRender: BaseUIElement[] = trs.map(tr => new SubstitutedTranslation(tr, tagsSource))
if(valuesToRender.length === 1){ if (valuesToRender.length === 1) {
return valuesToRender[0]; return valuesToRender[0];
}else if(valuesToRender.length > 1){ } else if (valuesToRender.length > 1) {
return new List(valuesToRender) return new List(valuesToRender)
} }
return undefined; return undefined;
}).map((element : BaseUIElement) => element?.SetClass(contentClasses)?.SetStyle(contentStyle))) }).map((element: BaseUIElement) => element?.SetClass(contentClasses)?.SetStyle(contentStyle)))
this.SetClass("flex items-center flex-row text-lg link-underline tag-renering-answer") this.SetClass("flex items-center flex-row text-lg link-underline")
this.SetStyle("word-wrap: anywhere;"); this.SetStyle("word-wrap: anywhere;");
} }