forked from MapComplete/MapComplete
Add border around longer radiobutton answers
This commit is contained in:
parent
9b2530197a
commit
929d07202f
4 changed files with 132 additions and 111 deletions
|
@ -14,11 +14,8 @@ export class FullScreenMessageBox extends UIElement {
|
|||
private readonly returnToTheMap: UIElement;
|
||||
|
||||
constructor(onClear: (() => void)) {
|
||||
super(undefined);
|
||||
|
||||
super();
|
||||
const self = this;
|
||||
|
||||
|
||||
State.state.fullScreenMessage.addCallbackAndRun(uiElement => {
|
||||
this._uielement = new Combine([State.state.fullScreenMessage.data]).SetStyle(
|
||||
"display:block;"+
|
||||
|
|
|
@ -294,8 +294,15 @@ export class TagRendering extends UIElement implements TagDependantUIElement {
|
|||
(t0, t1) => t0.isEquivalent(t1)
|
||||
);
|
||||
}
|
||||
return new FixedInputElement(this.ApplyTemplate(mapping.txt), mapping.k,
|
||||
|
||||
let txt = this.ApplyTemplate(mapping.txt);
|
||||
if(txt.Render().indexOf("<img") >= 0){
|
||||
txt.SetClass("question-option-with-border");
|
||||
}
|
||||
const inputEl = new FixedInputElement(txt, mapping.k,
|
||||
(t0, t1) => t1.isEquivalent(t0));
|
||||
|
||||
return inputEl;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -185,14 +185,21 @@ export abstract class UIElement extends UIEventSource<string> {
|
|||
public SetClass(clss: string): UIElement {
|
||||
this.dumbMode = false;
|
||||
if (clss === "" && this.clss.length > 0) {
|
||||
this.clss = [];
|
||||
this.Update();
|
||||
throw "Use RemoveClass instead";
|
||||
} else if (this.clss.indexOf(clss) < 0) {
|
||||
this.clss.push(clss);
|
||||
this.Update();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
public RemoveClass(clss: string): UIElement {
|
||||
const i = this.clss.indexOf(clss);
|
||||
if (i >= 0) {
|
||||
this.clss.splice(i, 1);
|
||||
this.Update();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public SetStyle(style: string): UIElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue