1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

XFA - Give all the available space to the caption in case of checkButton

- a checkbox or radio doesn't have to be rescaled when the container is large so give the extra space to the caption to avoid some word wrapping.
  - when the caption is on the right, then put ui on the left as first element and so remove flex:row-reverse stuff.
This commit is contained in:
Calixte Denizet 2021-06-10 15:30:19 +02:00
parent c4cb71b68d
commit 58633ab9fd
2 changed files with 18 additions and 25 deletions

View file

@ -2387,25 +2387,30 @@ class Field extends XFAObject {
}
ui.children.push(caption);
return HTMLResult.success(html, bbox);
} else if (this.ui.checkButton) {
caption.attributes.class[0] = "xfaCaptionForCheckButton";
}
if (!ui.attributes.class) {
ui.attributes.class = [];
}
ui.children.splice(0, 0, caption);
switch (this.caption.placement) {
case "left":
ui.children.splice(0, 0, caption);
ui.attributes.class.push("xfaLeft");
break;
case "right":
ui.attributes.class.push("xfaRight");
ui.children.push(caption);
ui.attributes.class.push("xfaLeft");
break;
case "top":
ui.children.splice(0, 0, caption);
ui.attributes.class.push("xfaTop");
break;
case "bottom":
ui.attributes.class.push("xfaBottom");
ui.children.push(caption);
ui.attributes.class.push("xfaTop");
break;
case "inline":
// TODO;