Commit 722bbe73 authored by Iuri Matias's avatar Iuri Matias

trigger newScenario event and move out dependency

parent 236f26a8
......@@ -93,7 +93,14 @@ function runTab (opts, localRegistry) {
executionContext.event.register('contextChanged', recorder.clearAll.bind(recorder))
self.event.register('clearInstance', recorder.clearAll.bind(recorder))
var recorderInterface = new RecorderUI(recorder, self)
var recorderInterface = new RecorderUI(recorder, self._deps.logCallback)
recorderInterface.event.register('newScenario', (abi, address, contractName) => {
var noInstancesText = this._view.noInstancesText
if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) }
this._view.instanceContainer.appendChild(this._deps.udappUI.renderInstanceFromABI(abi, address, contractName))
})
recorderInterface.render()
self._view.collapsedView = yo`
......
var yo = require('yo-yo')
var remixLib = require('remix-lib')
var EventManager = remixLib.EventManager
var csjs = require('csjs-inject')
var css = require('../styles/run-tab-styles')
......@@ -8,10 +10,10 @@ var confirmDialog = require('../../execution/confirmDialog')
class RecorderUI {
constructor (recorder, parentSelf) {
constructor (recorder, logCallBack) {
this.recorder = recorder
this.parentSelf = parentSelf
this.logCallBack = this.parentSelf._deps.logCallback
this.logCallBack = logCallBack
this.event = new EventManager()
}
render () {
......@@ -67,10 +69,7 @@ class RecorderUI {
return modalDialogCustom.alert(error)
}
var noInstancesText = this.parentSelf._view.noInstancesText
if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) }
this.parentSelf._view.instanceContainer.appendChild(this.parentSelf._deps.udappUI.renderInstanceFromABI(abi, address, contractName))
this.event.trigger('newScenario', [abi, address, contractName])
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment