From bdcfd4c81418019018f3d223d8c95ba8ed0d25ad Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Aug 2017 14:28:08 +0200 Subject: [PATCH 1/4] remove uneeded css && margin on contracts ui --- assets/css/browser-solidity.css | 13 ------------- assets/css/universal-dapp.css | 14 -------------- src/universal-dapp.js | 3 --- 3 files changed, 30 deletions(-) diff --git a/assets/css/browser-solidity.css b/assets/css/browser-solidity.css index 0ac04b37e1..04d148c554 100644 --- a/assets/css/browser-solidity.css +++ b/assets/css/browser-solidity.css @@ -180,19 +180,6 @@ font-weight: bold; } -.contract.hidesub { - padding-bottom: 0; - margin: 0; -} - -.contract.hidesub > *:not(.title) { - display: none; -} - -.contract.hidesub > .title:before { - content: "\25B6"; -} - #output .udapp { border: 0 none; box-shadow: none; diff --git a/assets/css/universal-dapp.css b/assets/css/universal-dapp.css index 4454b0bd35..0ae6175871 100644 --- a/assets/css/universal-dapp.css +++ b/assets/css/universal-dapp.css @@ -109,12 +109,6 @@ cursor: pointer; } -.udapp .instance.hidesub .title { - margin-bottom: 0; - padding-right: 1.5em; - word-wrap: break-word; -} - .udapp .instance .title:before { content: "\25BC"; opacity: 0.5; @@ -123,14 +117,6 @@ margin-top: 0.2em; } -.udapp .instance.hidesub > *:not(.title) { - display: none; -} - -.udapp .instance.hidesub > .title:before { - content: "\25B6"; -} - #runTabView .contractProperty { overflow: auto; margin-bottom: 0.4em; diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 981b782906..5f8b56c948 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -57,9 +57,6 @@ var css = csjs` content: "\\25B8"; margin-right: 5%; } - .instance.hidesub { - margin: 0; - } .instance.hidesub > * { display: none; } From ca844614488a4557e0da7e58b9c90935020f0f95 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Aug 2017 14:51:13 +0200 Subject: [PATCH 2/4] add margin --- src/universal-dapp.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 5f8b56c948..cb75b0de21 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -47,6 +47,7 @@ var css = csjs` } .instance { ${styles.displayBox} + margin-bottom: 0.5%; padding: 10px 15px 6px 15px; } .instance .title:before { From 3b90f4c9845fb0b65dcce876ece1890ef8e85551 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Aug 2017 14:54:11 +0200 Subject: [PATCH 3/4] 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)) } From f79d684aa55219f0babef50a0e0aee7fb88ae413 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 28 Aug 2017 14:57:19 +0200 Subject: [PATCH 4/4] fix instances margin --- src/universal-dapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index cb75b0de21..a9e498af59 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -47,7 +47,7 @@ var css = csjs` } .instance { ${styles.displayBox} - margin-bottom: 0.5%; + margin-bottom: 2px; padding: 10px 15px 6px 15px; } .instance .title:before {