From bedee71eb6b255491bac42cb6d1ace5a5ff25be0 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 20 Dec 2021 17:20:47 +0100 Subject: Use ID instead of class for battle dialog. --- ui.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ui.js') diff --git a/ui.js b/ui.js index f69a376..c46a99f 100644 --- a/ui.js +++ b/ui.js @@ -744,7 +744,7 @@ function update_battle() { let flash_timer = 0; function start_flash() { - let element = document.querySelector(".battle_message"); + let element = document.getElementById("battle_message"); let tick = true; if (flash_timer) return; @@ -783,20 +783,20 @@ function on_update() { update_map(); if (game.battle) { - document.querySelector(".battle_header").textContent = game.battle.title; - document.querySelector(".battle_message").textContent = game.battle.flash; + document.getElementById("battle_header").textContent = game.battle.title; + document.getElementById("battle_message").textContent = game.battle.flash; if (game.flash_next) start_flash(); - document.querySelector(".battle").classList.add("show"); + document.getElementById("battle").classList.add("show"); update_battle(); } else { - document.querySelector(".battle").classList.remove("show"); + document.getElementById("battle").classList.remove("show"); } } build_map(); -drag_element_with_mouse(".battle", ".battle_header"); +drag_element_with_mouse("#battle", "#battle_header"); scroll_with_middle_mouse("#grid_center", 3); init_map_zoom(); init_shift_zoom(); -- cgit v1.2.3