From 0e911d972c9b8840cc5ee3a421524c27d8f615be Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 14 Apr 2020 10:37:53 +0200 Subject: [PATCH] get parent element --- src/app/ui/txLogger.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/app/ui/txLogger.js b/src/app/ui/txLogger.js index e61cfd1e27..4072a96526 100644 --- a/src/app/ui/txLogger.js +++ b/src/app/ui/txLogger.js @@ -353,10 +353,15 @@ function txDetails (e, tx, data, obj) { const arrowUp = yo`` const arrowDown = yo`` - const parentTxSpan = e.toElement.parentElement.parentElement - let table = parentTxSpan.querySelector(`#${tx.id} [class^="txTable"]`) - const log = parentTxSpan.querySelector(`#${tx.id} [class^='log']`) - const arrow = parentTxSpan.querySelector(`#${tx.id} [class^='arrow']`) + let blockElement = e.target + while (true) { // get the parent block element + if (blockElement.className.startsWith('block')) break + else blockElement = blockElement.parentElement + } + + let table = blockElement.querySelector(`#${tx.id} [class^="txTable"]`) + const log = blockElement.querySelector(`#${tx.id} [class^='log']`) + const arrow = blockElement.querySelector(`#${tx.id} [class^='arrow']`) if (table && table.parentNode) { tx.removeChild(table)