From 7bd9b6c16be4f37b04ae920e8eb3a2d6a8d261cf Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Fri, 15 Jan 2021 18:20:52 +0100 Subject: [PATCH] add class to board instead of cells --- public/trivabble.css | 8 ++++---- public/trivabble.js | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/trivabble.css b/public/trivabble.css index ce40519..b36d130 100644 --- a/public/trivabble.css +++ b/public/trivabble.css @@ -125,19 +125,19 @@ html, #board, [draggable], .tile { overflow:hidden; } -.special-cell-label-clip { +.special-cell-label-clip .special-cell-label { text-overflow:clip; } -.special-cell-label-dots { +.special-cell-label-dots .special-cell-label { text-overflow:ellipsis; } -.special-cell-label-none { +.special-cell-label-none .special-cell-label { visibility:hidden; } -.special-cell-label-short { +.special-cell-label-short .special-cell-label { display:inline; } diff --git a/public/trivabble.js b/public/trivabble.js index 7ce7c1c..6c843b7 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -2317,14 +2317,14 @@ setSetting("CellCaptions", mode); document.getElementById("cell-captions").value = mode; - for (const cells of [].slice.call(document.getElementsByClassName("special-cell-label"))) { - cells.classList.remove("special-cell-label-clip"); - cells.classList.remove("special-cell-label-dots"); - cells.classList.remove("special-cell-label-none"); - cells.classList.remove("special-cell-label-short"); + 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"); - cells.classList.add("special-cell-label-" + mode); + 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; } } -- 2.30.2