diff --git a/src/app.js b/src/app.js index cff05fc284..3eb4c96352 100644 --- a/src/app.js +++ b/src/app.js @@ -214,8 +214,21 @@ 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].dataset.unit + var unit = 'ether' // default + if (selectedUnit === 'ether') { + unit = 'ether' + } else if (selectedUnit === 'finney') { + unit = 'finney' + } else if (selectedUnit === 'gwei') { + unit = 'gwei' + } else if (selectedUnit === 'wei') { + unit = 'wei' + } + cb(null, executionContext.web3().toWei(number, unit)) } catch (e) { cb(e) } diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index ed3ea87993..b6f94a7895 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -20,6 +20,9 @@ var css = csjs` align-items: end; justify-content: space-between; } + .txLog { + width: 75%; + } .tx { color: ${styles.terminal.text_Title_TransactionLog}; font-weight: bold; @@ -45,19 +48,11 @@ var css = csjs` .buttons { display: flex; } - .debug { - ${styles.terminal.button_Log_Debug} - } - .details { - ${styles.terminal.button_Log_Details} - } .debug, .details { - min-height: 18px; - max-height: 18px; - width: 45px; - min-width: 45px; - font-size: 10px; + color: ${styles.terminal.link_Debug}; + min-width: 55px; margin-left: 5px; + cursor: pointer; } .clipboardCopy { margin-right: 0.5em; @@ -206,7 +201,7 @@ function renderCall (self, data) { var tx = yo`
- [call] from:${from}, to:${to}, data:${input}, return: + [call] from:${from}, to:${to}, data:${input}, return:
@@ -284,7 +279,7 @@ function renderUnknownTransaction (self, data) { } function renderEmptyBlock (self, data) { - return yo`[block:${data.block.number} - 0 transactions]` + return yo`[block:${data.block.number} - 0 transactions]` } function context (self, opts) { @@ -300,13 +295,13 @@ function context (self, opts) { var i = data.tx.transactionIndex var value = val ? typeConversion.toInt(val) : 0 if (executionContext.getProvider() === 'vm') { - return yo`[vm] from:${from}, to:${to}, value:${value} wei, data:${input}, ${logs} logs, hash:${hash}` + return yo`[vm] from:${from}, to:${to}, value:${value} wei, data:${input}, ${logs} logs, hash:${hash}` } else if (executionContext.getProvider() !== 'vm' && data.resolvedData) { - return yo`[block:${block} txIndex:${i}] from:${from}, to:${to}, value:${value} wei, ${logs} logs, data:${input}, hash:${hash}` + return yo`[block:${block} txIndex:${i}] from:${from}, to:${to}, value:${value} wei, ${logs} logs, data:${input}, hash:${hash}` } else { to = helper.shortenHexData(to) hash = helper.shortenHexData(data.tx.blockHash) - return yo`[block:${block} txIndex:${i}] from:${from}, to:${to}, value:${value} wei` + return yo`[block:${block} txIndex:${i}] from:${from}, to:${to}, value:${value} wei` } } diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 481aa6b1ad..7610715368 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -269,6 +269,7 @@ class EditorPanel { self._view.terminal = self._components.terminal.render() self._view.content = yo`
+ ${self._renderTabsbar()}
${self._api.contextview.render()}
@@ -278,7 +279,6 @@ class EditorPanel { ` self._view.el = yo`
- ${self._renderTabsbar()} ${self._view.content}
` diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 3aaac2477f..05a284d940 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; @@ -81,6 +91,7 @@ var css = csjs` } .contractNames { ${styles.rightPanel.runTab.dropdown_RunTab} + width: 100%; } .subcontainer { display: flex; @@ -151,15 +162,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; } @@ -254,8 +265,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 +275,12 @@ function contractDropdown (appAPI, appEvents, instanceContainer) {
-
At Address
- ${atAddressButtonInput} + ${createButtonInput} +
Create
-
Create
- ${createButtonInput} + ${atAddressButtonInput} +
At Address
@@ -406,13 +417,19 @@ function settings (appAPI, appEvents) {
Gas limit
-
+
Value
- + +
` diff --git a/src/universal-dapp.js b/src/universal-dapp.js index fe46a18d3d..6d69f98a4b 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; @@ -63,7 +66,7 @@ var css = csjs` .instance.hidesub > * { display: none; } - .instance.hidesub .title { + .instance.hidesub .titleLine { display: flex; } .copy { @@ -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 () { diff --git a/test-browser/helpers/contracts.js b/test-browser/helpers/contracts.js index ec9ea6ca18..3b8d76554b 100644 --- a/test-browser/helpers/contracts.js +++ b/test-browser/helpers/contracts.js @@ -67,10 +67,14 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e // this => browser this.waitForElementPresent('.instance button[title="' + fnFullName + '"]') .perform(function (client, done) { - if (expectedInput) { - client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, function () {}) - } - done() + client.execute(function () { + document.querySelector('#optionViews').scrollTop = document.querySelector('#optionViews').scrollHeight + }, [], function () { + if (expectedInput) { + client.setValue('#runTabView input[title="' + expectedInput.types + '"]', expectedInput.values, function () {}) + } + done() + }) }) .click('.instance button[title="' + fnFullName + '"]') .pause(500)