fix toggle text
This commit is contained in:
parent
10a8c9bcb2
commit
06e1d9d14f
9
main.js
9
main.js
@ -745,6 +745,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleText(current, ...variants) {
|
||||||
|
let index = variants.indexOf(current)
|
||||||
|
if (index == -1) return null
|
||||||
|
|
||||||
|
return variants[index + 1 < variants.length ? index + 1 : 0]
|
||||||
|
}
|
||||||
|
|
||||||
function makeSwiper(dialog, fileListContainer, src) {
|
function makeSwiper(dialog, fileListContainer, src) {
|
||||||
let files = [...fileListContainer.querySelectorAll(`:is(.preview, .preview-small)`)]
|
let files = [...fileListContainer.querySelectorAll(`:is(.preview, .preview-small)`)]
|
||||||
|
|
||||||
@ -1513,7 +1520,7 @@
|
|||||||
|
|
||||||
collapseButton.addEventListener("click", () => {
|
collapseButton.addEventListener("click", () => {
|
||||||
toggleStagePageRows(rows)
|
toggleStagePageRows(rows)
|
||||||
collapseButton.textContent = "Скрыть"
|
collapseButton.textContent = toggleText(collapseButton.textContent, "Показать", "Скрыть")
|
||||||
})
|
})
|
||||||
|
|
||||||
document.querySelector(`table tr:first-child th`).append(collapseButton)
|
document.querySelector(`table tr:first-child th`).append(collapseButton)
|
||||||
|
Loading…
Reference in New Issue
Block a user