Don't set cell caption setting on load
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Sat, 24 Apr 2021 19:29:15 +0000 (21:29 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Sat, 24 Apr 2021 19:29:15 +0000 (21:29 +0200)
public/trivabble.js

index b485aae84d908258d425acfd7b758fa0a7d3ea70..5dff925840b20c5a99bcdc478722d8a3a81e8d52 100644 (file)
     function initCellCaptions() {
         setCellCaptions(getSetting("CELL_CAPTIONS"));
 
-        document.getElementById("cell-captions").onclick = function () {
+        document.getElementById("cell-captions").onchange = function () {
             setCellCaptions(document.getElementById("cell-captions").value);
+            setSetting("CELL_CAPTIONS", mode);
         };
     }
 
     function setCellCaptions(mode) {
-        setSetting("CELL_CAPTIONS", mode);
         document.getElementById("cell-captions").value = mode;
 
         board.classList.remove("special-cell-label-short");