allow variable number of checkboxes

This commit is contained in:
Zhora Shalyapin 2024-12-02 09:45:06 +00:00
parent 2f50fd5e9f
commit 446e00493d

21
main.js
View File

@ -73,6 +73,16 @@
return container
}
function createFromMulti(rows, classList, data) {
let rowData = []
let toIndex = data.to ?? rows.length - 1
for (let i = data.from; i <= toIndex; i++) {
rowData.push({ index: i })
}
return createFrom(rows, classList, rowData)
}
function addCss(link) {
let css = document.createElement("link")
css.href = link
@ -856,13 +866,10 @@
/* BOTTOM OPTIONS */
let bottomOptionsContainer = createFrom(rows, "options bottom-options", [
{ index: 59 },
{ index: 60 },
{ index: 61 },
{ index: 62 },
{ index: 63 }
])
let bottomOptionsContainer = createFromMulti(rows, "options bottom-options", {
from: 59,
to: rows.length - 3
})
/* APPEND ALL */