diff --git a/src/ui/DropdownPanel.js b/src/ui/DropdownPanel.js index 6f7a2692b8..ebee085fac 100644 --- a/src/ui/DropdownPanel.js +++ b/src/ui/DropdownPanel.js @@ -81,4 +81,9 @@ DropdownPanel.prototype.toggle = function () { } } +DropdownPanel.prototype.hide = function () { + var el = this.view.querySelector('.dropdownpanel') + el.style.display = 'none' +} + module.exports = DropdownPanel diff --git a/src/ui/TxBrowser.js b/src/ui/TxBrowser.js index 55b8788473..8ade85d3c2 100644 --- a/src/ui/TxBrowser.js +++ b/src/ui/TxBrowser.js @@ -37,6 +37,7 @@ TxBrowser.prototype.setDefaultValues = function () { this.connectInfo = '' this.basicPanel.data = {} this.basicPanel.update() + this.basicPanel.hide() this.updateWeb3Url(util.web3.currentProvider.host) } @@ -57,33 +58,37 @@ TxBrowser.prototype.submit = function () { }) } } catch (e) { - console.log(e) + self.update(e.message) } } TxBrowser.prototype.update = function (error, tx) { + var info = {} if (error) { console.log(error) - return - } - var info = {} - if (tx) { - if (!tx.to) { - tx.to = traceHelper.contractCreationToken('0') - } - info.from = tx.from - info.to = tx.to - info.hash = tx.hash - this.event.trigger('newTraceRequested', [this.blockNumber, this.txNumber, tx]) + info[''] = error } else { - var mes = '' - info.from = mes - info.to = mes - info.hash = mes - console.log('cannot find ' + this.blockNumber + ' ' + this.txNumber) + if (tx) { + if (!tx.to) { + tx.to = traceHelper.contractCreationToken('0') + } + info.from = tx.from + info.to = tx.to + info.hash = tx.hash + this.event.trigger('newTraceRequested', [this.blockNumber, this.txNumber, tx]) + } else { + var mes = '' + info.from = mes + info.to = mes + info.hash = mes + console.log('cannot find ' + this.blockNumber + ' ' + this.txNumber) + } } this.basicPanel.data = info this.basicPanel.update() + if (error) { + this.basicPanel.toggle() + } } TxBrowser.prototype.updateWeb3Url = function (newhost) {