From 6430fbe8a22a50b3389f44e84154d5f3b5d6572e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 4 Oct 2021 12:32:21 +0200 Subject: 300: Add tooltips to card numbers in game log. --- public/common/client.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/common/client.js b/public/common/client.js index a6b3453..9ef89e5 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -321,6 +321,12 @@ function on_update_bar() { old_active = game.active; } +let create_log_entry = function (text) { + let p = document.createElement("div"); + p.textContent = text; + return p; +} + function on_update_log() { let parent = document.getElementById("log"); let to_delete = parent.children.length - game.log_start; @@ -329,9 +335,7 @@ function on_update_log() { --to_delete; } for (let entry of game.log) { - let p = document.createElement("div"); - p.textContent = entry; - parent.prepend(p); + parent.prepend(create_log_entry(entry)); } } -- cgit v1.2.3