Fix open/close for tx logs in terminal from network

pull/1/head
ninabreznik 7 years ago
parent a800874381
commit 6445a7ac35
  1. 14
      src/app/execution/txLogger.js

@ -237,8 +237,8 @@ function renderUnknownTransaction (self, data) {
var obj = {from, to}
var tx = yo`
<span id="tx${data.tx.hash}">
<i class="${css.caret} fa fa-caret-right"></i>
<div class="${css.log}" onclick=${e => txDetails(e, tx, data, obj)}>
<i class="${css.caret} fa fa-caret-right"></i>
${context(self, {from, to, data})}
<div class=${css.buttons}>
<div class=${css.debug} onclick=${(e) => debug(e, data, self)}>Debug</div>
@ -264,7 +264,7 @@ function context (self, opts) {
var val = data.tx.value
var hash = data.tx.hash ? helper.shortenHexData(data.tx.hash) : ''
var input = data.tx.input ? helper.shortenHexData(data.tx.input) : ''
var logs = data.logs && data.logs.decoded ? data.logs.decoded.length : 0
var logs = data.logs && data.logs.decoded && data.logs.decoded.length ? data.logs.decoded.length : 0
var block = data.tx.blockNumber || ''
var i = data.tx.transactionIndex
var value = val ? typeConversion.toInt(val) : 0
@ -299,7 +299,6 @@ function context (self, opts) {
hash = helper.shortenHexData(data.tx.blockHash)
return yo`
<div>
<i class="${css.caret} fa fa-caret-right"></i>
<span class=${css.txLog}>
<span class='${css.tx}'>[block:${block} txIndex:${i}]</span>
<div class=${css.txItem}><span class=${css.txItemTitle}>from:</span> ${from}</div>
@ -318,8 +317,13 @@ function txDetails (e, tx, data, obj) {
var table = document.querySelector(`#${tx.id} [class^="txTable"]`)
var from = obj.from
var to = obj.to
var log = document.querySelector(`#${tx.id} [class^='log']`)
var caret = document.querySelector(`#${tx.id} [class^='caret']`)
var log = e.currentTarget
for (var i = 0; i < log.children.length; i++) {
if (~log.children[i].className.indexOf('caret')) {
var caret = log.children[i]
break
}
}
var caretDown = yo`<i class="${css.caret} fa fa-caret-down"></i>`
var caretRight = yo`<i class="${css.caret} fa fa-caret-right"></i>`
if (table && table.parentNode) {

Loading…
Cancel
Save