Unverified Commit cf99d6aa authored by bunsenstraat's avatar bunsenstraat Committed by GitHub

Merge pull request #1265 from ethereum/logfix

fix logger bug
parents 9909c1d2 886b847b
...@@ -354,6 +354,17 @@ module.exports = TxLogger ...@@ -354,6 +354,17 @@ module.exports = TxLogger
// helpers // helpers
function isDescendant (parent, child) {
var node = child.parentNode
while (node != null) {
if (node === parent) {
return true
}
node = node.parentNode
}
return false
}
function txDetails (e, tx, data, obj) { function txDetails (e, tx, data, obj) {
const from = obj.from const from = obj.from
const to = obj.to const to = obj.to
...@@ -368,9 +379,13 @@ function txDetails (e, tx, data, obj) { ...@@ -368,9 +379,13 @@ function txDetails (e, tx, data, obj) {
} else break } else break
} }
let table = blockElement.querySelector(`#${tx.id} [class^="txTable"]`) const tables = blockElement.querySelectorAll(`#${tx.id} [class^="txTable"]`)
const log = blockElement.querySelector(`#${tx.id} [class^='log']`) const logs = blockElement.querySelectorAll(`#${tx.id} [class^='log']`)
const arrow = blockElement.querySelector(`#${tx.id} [class^='arrow']`) const arrows = blockElement.querySelectorAll(`#${tx.id} [class^='arrow']`)
let table = [...tables].filter((t) => isDescendant(tx, t))[0]
const log = [...logs].filter((t) => isDescendant(tx, t))[0]
const arrow = [...arrows].filter((t) => isDescendant(tx, t))[0]
if (table && table.parentNode) { if (table && table.parentNode) {
tx.removeChild(table) tx.removeChild(table)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment