Limit changes on cell text content

This commit is contained in:
Laurent Mazet 2021-01-15 18:36:36 +01:00
parent 7bd9b6c16b
commit ae79bb84b8
1 changed files with 20 additions and 8 deletions

View File

@ -2317,16 +2317,28 @@
setSetting("CellCaptions", mode);
document.getElementById("cell-captions").value = mode;
board.classList.remove("special-cell-label-clip");
board.classList.remove("special-cell-label-dots");
board.classList.remove("special-cell-label-none");
board.classList.remove("special-cell-label-short");
if (board.classList.contains("special-cell-label-short")) {
board.classList.remove("special-cell-label-short");
if (mode !== "short") {
for (const cell of [].slice.call(document.getElementsByClassName("special-cell-label"))) {
cell.textContent = cell.longText;
}
}
} else {
board.classList.remove("special-cell-label-clip");
board.classList.remove("special-cell-label-dots");
board.classList.remove("special-cell-label-none");
if (mode === "short") {
for (const cell of [].slice.call(document.getElementsByClassName("special-cell-label"))) {
cell.textContent = cell.shortText;
}
}
}
board.classList.add("special-cell-label-" + mode);
for (const cells of [].slice.call(document.getElementsByClassName("special-cell-label"))) {
cells.textContent = (mode === "short") ? cells.shortText : cells.longText;
}
}
function repromptName(f) {