Fixes to run tab: more units, add dataset, new title etc.

pull/1/head
ninabreznik 7 years ago committed by yann300
parent bb35bb58fe
commit 745eb8891f
  1. 14
      src/app.js
  2. 16
      src/app/tabs/run-tab.js

@ -217,9 +217,17 @@ function run () {
var number = document.querySelector('#value').value var number = document.querySelector('#value').value
var select = document.getElementById('unit') var select = document.getElementById('unit')
var index = select.selectedIndex var index = select.selectedIndex
var selectedUnit = select.querySelectorAll('option')[index].innerHTML var selectedUnit = select.querySelectorAll('option')[index].dataset.unit
var unit = '' var unit = 'ether' // default
if (selectedUnit === 'wei') { unit = 'wei' } 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)) cb(null, executionContext.web3().toWei(number, unit))
} catch (e) { } catch (e) {
cb(e) cb(e)

@ -161,15 +161,15 @@ var css = csjs`
margin-left: 10%; margin-left: 10%;
} }
.errorIcon { .errorIcon {
color: ${styles.colors.red};; color: ${styles.colors.red};
margin-left: 15px; margin-left: 15px;
} }
.errorIcon { .errorIcon {
color: ${styles.colors.red};; color: ${styles.colors.red};
margin-left: 15px; margin-left: 15px;
} }
.failDesc { .failDesc {
color: ${styles.colors.red};; color: ${styles.colors.red};
padding-left: 10px; padding-left: 10px;
display: inline; display: inline;
} }
@ -264,7 +264,7 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
} }
}) })
var atAddressButtonInput = yo`<input class="${css.input} ataddressinput" placeholder="Enter address of contract you want to load" title="atAddress" />` var atAddressButtonInput = yo`<input class="${css.input} ataddressinput" placeholder="Load contract from Address" title="atAddress" />`
var createButtonInput = yo`<input class="${css.input}" placeholder="" title="Create" />` var createButtonInput = yo`<input class="${css.input}" placeholder="" title="Create" />`
var selectContractNames = yo`<select class="${css.contractNames}" disabled></select>` var selectContractNames = yo`<select class="${css.contractNames}" disabled></select>`
var el = yo` var el = yo`
@ -422,10 +422,12 @@ function settings (appAPI, appEvents) {
</div> </div>
<div class="${css.crow}"> <div class="${css.crow}">
<div class="${css.col1_1}">Value</div> <div class="${css.col1_1}">Value</div>
<input type="text" class="${css.col2_1}" id="value" value="0" title="Default the value is set to be in ether, if you want the value to be in wei, type i.e. 7 wei."> <input type="text" class="${css.col2_1}" id="value" value="0" title="Enter the value and choose the unit">
<select name="unit" class="${css.col2_2}" id="unit"> <select name="unit" class="${css.col2_2}" id="unit">
<option id="unit-eth">eth</option> <option data-unit="wei">wei</option>
<option id="unit-wei">wei</option> <option data-unit="mwei">mwei</option>
<option data-unit="microether">microether</option>
<option data-unit="ether">ether</option>
</select> </select>
</div> </div>
</div> </div>

Loading…
Cancel
Save