From 976c21152670624a9957752cd30b18e2ad55d5b4 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 6 Feb 2018 11:23:27 -0500 Subject: [PATCH] add udappUI to app object and update references --- src/app.js | 4 +++- src/app/tabs/run-tab.js | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app.js b/src/app.js index 7a709392ac..cd7206afa7 100644 --- a/src/app.js +++ b/src/app.js @@ -265,7 +265,6 @@ function run () { }) var udappUI = new UniversalDAppUI(udapp) - console.dir(udappUI) udapp.reset({}, transactionContextAPI) udapp.event.register('debugRequested', this, function (txResult) { @@ -582,6 +581,9 @@ function run () { udapp: () => { return udapp }, + udappUI: () => { + return udappUI + }, switchFile: function (path) { fileManager.switchFile(path) }, diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index c0d62140ae..f7b2385671 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -379,7 +379,7 @@ function makeRecorder (events, appAPI, appEvents) { if (txArray.length) { noInstancesText.style.display = 'none' recorder.run(txArray, accounts, options, abis, linkReferences, (abi, address, contractName) => { - instanceContainer.appendChild(appAPI.udapp().renderInstanceFromABI(abi, address, contractName)) + instanceContainer.appendChild(appAPI.udappUI().renderInstanceFromABI(abi, address, contractName)) }) } } else { @@ -484,7 +484,7 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { } noInstancesText.style.display = 'none' var address = isVM ? txResult.result.createdAddress : txResult.result.contractAddress - instanceContainer.appendChild(appAPI.udapp().renderInstance(selectedContract.contract.object, address, selectContractNames.value)) + instanceContainer.appendChild(appAPI.udappUI().renderInstance(selectedContract.contract.object, address, selectContractNames.value)) } else { appAPI.logMessage(`creation of ${selectedContract.name} errored: ` + error) } @@ -509,11 +509,11 @@ function contractDropdown (events, appAPI, appEvents, instanceContainer) { } catch (e) { return modalDialogCustom.alert('Failed to parse the current file as JSON ABI.') } - instanceContainer.appendChild(appAPI.udapp().renderInstanceFromABI(abi, address, address)) + instanceContainer.appendChild(appAPI.udappUI().renderInstanceFromABI(abi, address, address)) }) } else { var contract = appAPI.getContract(contractNames.children[contractNames.selectedIndex].innerHTML) - instanceContainer.appendChild(appAPI.udapp().renderInstance(contract.object, address, selectContractNames.value)) + instanceContainer.appendChild(appAPI.udappUI().renderInstance(contract.object, address, selectContractNames.value)) } }