diff --git a/src/app.js b/src/app.js index cff05fc284..720788e895 100644 --- a/src/app.js +++ b/src/app.js @@ -214,8 +214,13 @@ function run () { }, getValue: (cb) => { try { - var comp = $('#value').val().split(' ') - cb(null, executionContext.web3().toWei(comp[0], comp.slice(1).join(' '))) + 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' } + 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 3aaac2477f..b8c2484aa2 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -45,6 +45,16 @@ var css = csjs` .col2 { ${styles.rightPanel.runTab.input_RunTab} } + .col2_1 { + ${styles.rightPanel.runTab.input_RunTab} + width: 165px; + min-width: 165px; + } + .col2_2 { + ${styles.rightPanel.runTab.dropdown_RunTab} + width: 82px; + min-width: 82px; + } .select { ${styles.rightPanel.runTab.dropdown_RunTab} font-weight: normal; @@ -254,8 +264,8 @@ function contractDropdown (appAPI, appEvents, instanceContainer) { } }) - var atAddressButtonInput = yo`` - var createButtonInput = yo`` + var atAddressButtonInput = yo`` + var createButtonInput = yo`` var selectContractNames = yo`` var el = yo`
@@ -264,12 +274,12 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
-
At Address
- ${atAddressButtonInput} + ${createButtonInput} +
Create
-
Create
- ${createButtonInput} + ${atAddressButtonInput} +
Load
@@ -412,7 +422,11 @@ function settings (appAPI, appEvents) {
Value
- + +
` diff --git a/src/universal-dapp.js b/src/universal-dapp.js index fe46a18d3d..d5a4c54ce9 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -36,12 +36,15 @@ var css = csjs` justify-content: space-between; align-items: center; font-size: 11px; - width: 75%; - min-width: 500px; + min-width: 350px; overflow: hidden; word-break: break-word; line-height: initial; } + .titleLine { + display: flex; + align-items: baseline; + } .titleText { margin-right: 1em; word-break: break-word; @@ -295,13 +298,17 @@ UniversalDApp.prototype.renderInstance = function (contract, address, contractNa address = (address.slice(0, 2) === '0x' ? '' : '0x') + address.toString('hex') var shortAddress = helper.shortenAddress(address) - var title = yo`
-
${contractName} at ${shortAddress} (${context})
- -
` + var title = yo` +
+
+
${contractName} at ${shortAddress} (${context})
+
+ +
+ ` if (self.removable_instances) { var close = yo`
` - title.appendChild(close) + title.querySelector(`.${css.title}`).appendChild(close) } function toggleClass () {