diff --git a/src/main/resources/org/biouno/unochoice/common/checkbox-content.js b/src/main/resources/org/biouno/unochoice/common/checkbox-content.js new file mode 100644 index 00000000..39d8add4 --- /dev/null +++ b/src/main/resources/org/biouno/unochoice/common/checkbox-content.js @@ -0,0 +1,19 @@ +window.addEventListener("DOMContentLoaded", () => { + document.querySelectorAll(".checkbox-content-data-holder").forEach((dataHolder) => { + const { maxCount, randomName } = dataHolder.dataset; + + var height = 0; + var refElement = document.getElementById(`ecp_${randomName}_0`); + if (maxCount > 0 && refElement && refElement.offsetHeight != 0) { + for (var i = 0; i < maxCount; i++) { + height += refElement.offsetHeight + 3; + } + } + else { + height = maxCount * 25.5; + } + + height = Math.floor(height); + document.getElementById(`ecp_${randomName}`).style.height = height + "px"; + }); +}); diff --git a/src/main/resources/org/biouno/unochoice/common/checkboxContent.jelly b/src/main/resources/org/biouno/unochoice/common/checkboxContent.jelly index 628ab211..f2109d0b 100644 --- a/src/main/resources/org/biouno/unochoice/common/checkboxContent.jelly +++ b/src/main/resources/org/biouno/unochoice/common/checkboxContent.jelly @@ -1,7 +1,8 @@ + xmlns:transitionWrapper="transitionWrapper" + xmlns:st="jelly:stapler"> @@ -101,29 +102,6 @@ - + +