move provider change event out of tx browser; simplify set default values

pull/1/head
Iuri Matias 7 years ago committed by yann300
parent 04de04d404
commit b9050ba6b5
  1. 4
      src/app/debugger/debuggerUI.js
  2. 21
      src/app/debugger/debuggerUI/TxBrowser.js

@ -53,6 +53,10 @@ class DebuggerUI {
self.debugger_ui.unLoad() self.debugger_ui.unLoad()
}) })
this.debugger_ui.event.register('providerChanged', this, function (provider) {
txBrowser.setDefaultValues()
})
this.txBrowser = this.debugger_ui.txBrowser this.txBrowser = this.debugger_ui.txBrowser
} }

@ -53,14 +53,15 @@ function TxBrowser (_parent, opts) {
this.txNumber this.txNumber
this.view this.view
this.web3 = opts.web3 this.web3 = opts.web3
var self = this this.setDefaultValues()
_parent.event.register('providerChanged', this, function (provider) { // var self = this
self.setDefaultValues() // _parent.event.register('providerChanged', this, function (provider) {
// TODO: looks redudant since setDefaultValues already re-renders // self.setDefaultValues()
if (self.view) { // // TODO: looks redudant since setDefaultValues already re-renders
yo.update(self.view, self.render()) // if (self.view) {
} // yo.update(self.view, self.render())
}) // }
// })
} }
TxBrowser.prototype.setDefaultValues = function () { TxBrowser.prototype.setDefaultValues = function () {
@ -134,10 +135,6 @@ TxBrowser.prototype.load = function (txHash, tx) {
TxBrowser.prototype.unload = function (txHash) { TxBrowser.prototype.unload = function (txHash) {
this.event.trigger('unloadRequested') this.event.trigger('unloadRequested')
this.init()
}
TxBrowser.prototype.init = function (ev) {
this.setDefaultValues() this.setDefaultValues()
} }

Loading…
Cancel
Save