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:
parent
c4cb71b68d
commit
58633ab9fd
2 changed files with 18 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue