get parent element

pull/5370/head
yann300 5 years ago
parent 8a4805ddb2
commit 0e911d972c
  1. 13
      src/app/ui/txLogger.js

@ -353,10 +353,15 @@ function txDetails (e, tx, data, obj) {
const arrowUp = yo`<i class="${css.arrow} fas fa-angle-up"></i>` const arrowUp = yo`<i class="${css.arrow} fas fa-angle-up"></i>`
const arrowDown = yo`<i class="${css.arrow} fas fa-angle-down"></i>` const arrowDown = yo`<i class="${css.arrow} fas fa-angle-down"></i>`
const parentTxSpan = e.toElement.parentElement.parentElement let blockElement = e.target
let table = parentTxSpan.querySelector(`#${tx.id} [class^="txTable"]`) while (true) { // get the parent block element
const log = parentTxSpan.querySelector(`#${tx.id} [class^='log']`) if (blockElement.className.startsWith('block')) break
const arrow = parentTxSpan.querySelector(`#${tx.id} [class^='arrow']`) 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) { if (table && table.parentNode) {
tx.removeChild(table) tx.removeChild(table)

Loading…
Cancel
Save