From 745eb8891fe16659525f6da06b3635a20c73dc10 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Fri, 13 Oct 2017 15:25:30 +0100 Subject: [PATCH] Fixes to run tab: more units, add dataset, new title etc. --- src/app.js | 14 +++++++++++--- src/app/tabs/run-tab.js | 16 +++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/app.js b/src/app.js index 720788e895..be45a26415 100644 --- a/src/app.js +++ b/src/app.js @@ -217,9 +217,17 @@ function run () { var number = document.querySelector('#value').value var select = document.getElementById('unit') var index = select.selectedIndex - var selectedUnit = select.querySelectorAll('option')[index].innerHTML - var unit = '' - if (selectedUnit === 'wei') { unit = 'wei' } + var selectedUnit = select.querySelectorAll('option')[index].dataset.unit + var unit = 'ether' // default + if (selectedUnit === 'ether') { + unit = 'ether' + } else if (selectedUnit === 'microether') { + unit = 'microether' + } else if (selectedUnit === 'mwei') { + unit = 'mwei' + } else if (selectedUnit === 'wei') { + unit = 'wei' + } cb(null, executionContext.web3().toWei(number, unit)) } catch (e) { cb(e) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index b8c2484aa2..bc19731aeb 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -161,15 +161,15 @@ var css = csjs` margin-left: 10%; } .errorIcon { - color: ${styles.colors.red};; + color: ${styles.colors.red}; margin-left: 15px; } .errorIcon { - color: ${styles.colors.red};; + color: ${styles.colors.red}; margin-left: 15px; } .failDesc { - color: ${styles.colors.red};; + color: ${styles.colors.red}; padding-left: 10px; display: inline; } @@ -264,7 +264,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { } }) - var atAddressButtonInput = yo`` + var atAddressButtonInput = yo`` var createButtonInput = yo`` var selectContractNames = yo`` var el = yo` @@ -422,10 +422,12 @@ function settings (appAPI, appEvents) {
Value
- +