Misc: coding style
authorRaphaël Jakse <raphael.trivabble@jakse.fr>
Thu, 8 May 2025 10:36:07 +0000 (12:36 +0200)
committerRaphaël Jakse <raphael.trivabble@jakse.fr>
Thu, 8 May 2025 10:47:38 +0000 (12:47 +0200)
* Use a variable instead of repeating document.getElementById("panel")

public/trivabble.js

index e040e75026dd35e5d50449cc90eb126c6e218558..4eab158d3e18e6ffb468bb1da0d5e78f1a0d479e 100644 (file)
                 location.reload();
             }, function () {
                 blockMove = 1000;
-                document.getElementById("panel").appendChild(document.createElement("a"));
-                document.getElementById("panel").lastChild.href = "#";
-                document.getElementById("panel").lastChild.onclick = location.reload.bind(location);
-                document.getElementById("panel").lastChild.textContent = _("To continue playing, click here");
+                const panel = document.getElementById("panel");
+                panel.appendChild(document.createElement("a"));
+                panel.lastChild.href = "#";
+                panel.lastChild.onclick = location.reload.bind(location);
+                panel.lastChild.textContent = _("To continue playing, click here");
             }
         );
     }