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( var dropdownLogic = new DropdownLogic(
this.parentSelf._deps.fileManager, this._deps.fileManager,
this.parentSelf._deps.pluginManager, this._deps.pluginManager,
this.parentSelf._deps.compilersArtefacts, this._deps.compilersArtefacts,
this.parentSelf._deps.compiler, this._deps.compiler,
this.parentSelf._deps.config, this._deps.config,
this.parentSelf._deps.editor, this._deps.editor,
this.parentSelf._deps.udapp, this._deps.udapp,
this.parentSelf._deps.filePanel this._deps.filePanel
) )
var contractDropdownUI = new ContractDropdownUI(dropdownLogic, self) var contractDropdownUI = new ContractDropdownUI(dropdownLogic, this._deps.logCallback)
contractDropdownUI.event.register('clearInstance', () => { contractDropdownUI.event.register('clearInstance', () => {
var noInstancesText = this._view.noInstancesText var noInstancesText = this._view.noInstancesText

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

Loading…
Cancel
Save