diff --git a/main.js b/main.js index 9c68909..e61a6e1 100644 --- a/main.js +++ b/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) { let files = [...fileListContainer.querySelectorAll(`:is(.preview, .preview-small)`)] @@ -1513,7 +1520,7 @@ collapseButton.addEventListener("click", () => { toggleStagePageRows(rows) - collapseButton.textContent = "Скрыть" + collapseButton.textContent = toggleText(collapseButton.textContent, "Показать", "Скрыть") }) document.querySelector(`table tr:first-child th`).append(collapseButton)