remove need for parent self in contract dropdown ui

pull/3094/head
Iuri Matias 6 years ago committed by yann300
parent 59ccac608b
commit 98f520aed0
  1. 18
      src/app/tabs/run-tab.js
  2. 10
      src/app/tabs/runTab/contractDropdown.js

@ -143,16 +143,16 @@ function runTab (opts, localRegistry) {
})
var dropdownLogic = new DropdownLogic(
this.parentSelf._deps.fileManager,
this.parentSelf._deps.pluginManager,
this.parentSelf._deps.compilersArtefacts,
this.parentSelf._deps.compiler,
this.parentSelf._deps.config,
this.parentSelf._deps.editor,
this.parentSelf._deps.udapp,
this.parentSelf._deps.filePanel
this._deps.fileManager,
this._deps.pluginManager,
this._deps.compilersArtefacts,
this._deps.compiler,
this._deps.config,
this._deps.editor,
this._deps.udapp,
this._deps.filePanel
)
var contractDropdownUI = new ContractDropdownUI(dropdownLogic, self)
var contractDropdownUI = new ContractDropdownUI(dropdownLogic, this._deps.logCallback)
contractDropdownUI.event.register('clearInstance', () => {
var noInstancesText = this._view.noInstancesText

@ -8,9 +8,9 @@ var modalDialog = require('../../ui/modaldialog')
var MultiParamManager = require('../../../multiParamManager')
class ContractDropdownUI {
constructor (dropdownLogic, parentSelf) {
this.parentSelf = parentSelf
constructor (dropdownLogic, logCallback) {
this.dropdownLogic = dropdownLogic
this.logCallback = logCallback
this.event = new EventManager()
this.listenToEvents()
@ -143,14 +143,14 @@ class ContractDropdownUI {
}
var statusCb = (msg) => {
return this.parentSelf._deps.logCallback(msg)
return this.logCallback(msg)
}
var finalCb = (error, contractObject, address) => {
this.event.trigger('clearInstance')
if (error) {
return this.parentSelf._deps.logCallback(error)
return this.logCallback(error)
}
this.event.trigger('newContractInstanceAdded', [contractObject, address, this.selectContractNames.value])
@ -167,7 +167,7 @@ class ContractDropdownUI {
}}, {
label: 'Cancel',
fn: () => {
this.parentSelf._deps.logCallback(`creation of ${selectedContract.name} canceled by user.`)
this.logCallback(`creation of ${selectedContract.name} canceled by user.`)
}
})
}

Loading…
Cancel
Save