From 806a51b628a822ccdc77d921f27fd29beae7c16a Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 2 Sep 2023 00:39:20 +0200 Subject: [PATCH] modified HTML template strings to enable reusing SVG icons --- src/js/sr2ini.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/sr2ini.js b/src/js/sr2ini.js index 5620521..7314a07 100644 --- a/src/js/sr2ini.js +++ b/src/js/sr2ini.js @@ -33,16 +33,16 @@ const COMBATANT_TABLE_ROW = [ '\n', 'D+\n', '\n', - '\n', + '\n', '
\n', - '\n', + '\n', '
\n', '
\n', - '\n', + '\n', '
\n', - '\n', - '\n', - '\n', + '\n', + '\n', + '\n', '
\n', '
\n', '\n', @@ -60,7 +60,7 @@ const DAMAGE_MONITOR_HTML = [ '\n', '\n', '\n', - '\n', + '\n', '\n', ''].join(""); @@ -291,7 +291,7 @@ function addCombatant(e) { // apply damage to combatant function applyDamage(e) { - let $btn = $(e.target).is("button") ? $(e.target) : $(e.target).parent(); + let $btn = $(e.target).is("button") ? $(e.target) : $(e.target).closest("button"); // retrieve new damage level and type from button position and "damage-[type]" class let damageLevel = $btn.parent().parent().index(); if ( $btn.hasClass("active") ) {