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

Merge pull request #13532 from calixteman/radio

XFA - Give all the available space to the caption in case of checkButton
This commit is contained in:
Brendan Dahl 2021-06-10 12:30:49 -07:00 committed by GitHub
commit 02c03795f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;