Fix 'alert' in width

This commit is contained in:
Pieter Vander Vennet 2020-09-28 01:00:24 +02:00
parent 7d3840e041
commit 4cce18f818
2 changed files with 7 additions and 7 deletions

View file

@ -257,13 +257,15 @@ export class Widths extends LayerDefinition {
tags.targetWidth = r(props.targetWidth);
tags.short = "";
if (props.width < props.targetWidth) {
tags.short = r(props.targetWidth - props.width)
tags.short = `<span class='alert'>Dit is ${r(props.targetWidth - props.width)}m te weinig</span>`
}
console.log("SHORT", tags.short)
},
mappings:[
{k: new Tag("short","*"), txt: "De totale nodige ruimte voor vlot en veilig verkeer is dus <b>{targetWidth}m</b><br>" +
"Er is dus <span class='alert'>{short}m</span> te weinig", substitute: true},
{k: new Tag("short",""), txt: "De totale nodige ruimte voor vlot en veilig verkeer is dus <span class='thanks'>{targetWidth}m</span>"}
mappings: [
{
k: null,
txt: "De totale nodige ruimte voor vlot en veilig verkeer is dus <span class='thanks'>{targetWidth}m</span><br/>{short}"
}
]
}
).OnlyShowIf(this._notCarfree),

View file

@ -359,8 +359,6 @@ export class TagRendering extends UIElement implements TagDependantUIElement {
return undefined;
}
console.log("Creating a freeform input element for ", this._source.data._country);
return ValidatedTextField.Mapped(pickString, toString, {
placeholder: this._freeform.placeholder,
type: type,