From 3b90f4c9845fb0b65dcce876ece1890ef8e85551 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Aug 2017 14:54:11 +0200 Subject: [PATCH] fix dropdpwn selection in firefox --- src/app/tabs/compile-tab.js | 4 ++-- src/app/tabs/run-tab.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 537d787d95..acd2a13f9a 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -319,7 +319,7 @@ function compileTab (container, appAPI, appEvents, opts) { function details () { var select = el.querySelector('select') if (select.children.length > 0 && select.selectedIndex >= 0) { - var contractName = select.children[select.selectedIndex].innerText + var contractName = select.children[select.selectedIndex].innerHTML var details = contractsDetails[contractName] var keys = Object.keys(contractsDetails[contractName]) var log = yo`
` @@ -334,7 +334,7 @@ function compileTab (container, appAPI, appEvents, opts) { function publish (appAPI) { var selectContractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) if (selectContractNames.children.length > 0 && selectContractNames.selectedIndex >= 0) { - var contract = contractsDetails[selectContractNames.children[selectContractNames.selectedIndex].innerText] + var contract = contractsDetails[selectContractNames.children[selectContractNames.selectedIndex].innerHTML] publishOnSwarm(contract, appAPI, function (err) { if (err) { alert('Failed to publish metadata: ' + err) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index c4113e9a9e..6bdef60b09 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -278,7 +278,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { function setInputParamsPlaceHolder () { createButtonInput.value = '' if (appAPI.getContracts() && selectContractNames.selectedIndex >= 0 && selectContractNames.children.length > 0) { - var contract = appAPI.getContracts()[selectContractNames.children[selectContractNames.selectedIndex].innerText] + var contract = appAPI.getContracts()[selectContractNames.children[selectContractNames.selectedIndex].innerHTML] var ctrabi = txHelper.getConstructorInterface(contract.interface) if (ctrabi.inputs.length) { createButtonInput.setAttribute('placeholder', txHelper.inputParametersDeclarationToString(ctrabi.inputs)) @@ -296,7 +296,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { function createInstance () { var contractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) var contracts = appAPI.getContracts() - var contract = appAPI.getContracts()[contractNames.children[contractNames.selectedIndex].innerText] + var contract = appAPI.getContracts()[contractNames.children[contractNames.selectedIndex].innerHTML] var constructor = txHelper.getConstructorInterface(contract.interface) var args = createButtonInput.value txFormat.buildData(contract, contracts, true, constructor, args, appAPI.udapp(), appAPI.executionContext(), (error, data) => { @@ -338,7 +338,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { function loadFromAddress (appAPI) { noInstancesText.style.display = 'none' var contractNames = document.querySelector(`.${css.contractNames.classNames[0]}`) - var contract = appAPI.getContracts()[contractNames.children[contractNames.selectedIndex].innerText] + var contract = appAPI.getContracts()[contractNames.children[contractNames.selectedIndex].innerHTML] var address = atAddressButtonInput.value instanceContainer.appendChild(appAPI.udapp().renderInstance(contract, address, selectContractNames.value)) }