From 5e40bbdf36d5a79bc1021c052d8e5799ada48104 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Wed, 7 Aug 2019 10:07:21 +0200 Subject: [PATCH 1/5] used flexbox for browsersolidity items. --- src/app.js | 17 +++-------------- src/app/components/side-panel.js | 1 + src/lib/panels-resize.js | 5 +---- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/app.js b/src/app.js index cecb13aa1c..58fdc3071c 100644 --- a/src/app.js +++ b/src/app.js @@ -62,38 +62,27 @@ var css = csjs` overflow-x: auto; } .browsersolidity { - position : relative; width : 100vw; height : 100vh; overflow : hidden; + flex-direction : row; + display : flex; } .mainpanel { display : flex; flex-direction : column; - position : absolute; - top : 0; - bottom : 0; overflow : hidden; } .iconpanel { display : flex; flex-direction : column; - position : absolute; - top : 0; - bottom : 0; - left : 0; overflow : hidden; width : 50px; user-select : none; - /* border-right : 1px solid var(--primary); */ } .sidepanel { display : flex; - flex-direction : column; - position : absolute; - top : 0; - left : 50px; - bottom : 0; + flex-direction : row-reverse; } .highlightcode { position:absolute; diff --git a/src/app/components/side-panel.js b/src/app/components/side-panel.js index e478f35a6c..bfb41eeeb4 100644 --- a/src/app/components/side-panel.js +++ b/src/app/components/side-panel.js @@ -8,6 +8,7 @@ const css = csjs` height: 100%; display: flex; flex-direction: column; + flex: auto; } .swapitTitle { margin: 0; diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index c041c48121..1f4040ca3a 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -3,11 +3,8 @@ const csjs = require('csjs-inject') const css = csjs` .dragbar { - position : absolute; - top : 0px; width : 0.5em; - right : 0; - bottom : 0; + height : 100%; cursor : col-resize; z-index : 999; /* border-right : 2px solid var(--primary); */ From 2aa0ff90e8658f9a6b5fc2ed273bea521ce757d1 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 8 Aug 2019 15:39:12 +0200 Subject: [PATCH 2/5] fixed some sizes --- src/app.js | 2 ++ src/app/components/side-panel.js | 12 +++++------- src/app/components/vertical-icons.js | 8 ++++---- src/app/tabs/styles/run-tab-styles.js | 1 - src/app/udapp/run-tab.js | 2 +- src/lib/panels-resize.js | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/app.js b/src/app.js index 58fdc3071c..a77f3b7e54 100644 --- a/src/app.js +++ b/src/app.js @@ -72,6 +72,7 @@ var css = csjs` display : flex; flex-direction : column; overflow : hidden; + flex : 1; } .iconpanel { display : flex; @@ -83,6 +84,7 @@ var css = csjs` .sidepanel { display : flex; flex-direction : row-reverse; + width : 320px; } .highlightcode { position:absolute; diff --git a/src/app/components/side-panel.js b/src/app/components/side-panel.js index bfb41eeeb4..69764218d0 100644 --- a/src/app/components/side-panel.js +++ b/src/app/components/side-panel.js @@ -23,7 +23,6 @@ const css = csjs` } .swapitHeader { height: 35px; - padding: 15px 20px; display: flex; align-items: center; } @@ -33,7 +32,6 @@ const css = csjs` } .pluginsContainer { height: 100%; - flex: 1; overflow-y: auto; } .titleInfo { @@ -132,10 +130,10 @@ export class SidePanel extends AbstractPanel { } return yo` -
-
${name}
- ${docLink} - ${versionWarning} +
+
${name}
+ ${docLink} + ${versionWarning}
` } @@ -144,7 +142,7 @@ export class SidePanel extends AbstractPanel { return yo`
${this.header} -
+
${this.view}
` diff --git a/src/app/components/vertical-icons.js b/src/app/components/vertical-icons.js index f458e7afeb..5012e68006 100644 --- a/src/app/components/vertical-icons.js +++ b/src/app/components/vertical-icons.js @@ -160,9 +160,9 @@ export class VerticalIcons extends Plugin { }) // remove active - const currentActive = this.view.querySelector(`.${css.active}`) + const currentActive = this.view.querySelector(`.active`) if (currentActive) { - currentActive.classList.remove(css.active) + currentActive.classList.remove(`active`) } } @@ -176,7 +176,7 @@ export class VerticalIcons extends Plugin { const nextActive = this.view.querySelector(`[plugin="${name}"]`) if (nextActive) { let image = nextActive.querySelector('.image') - nextActive.classList.add(css.active) + nextActive.classList.add(`active`) image.style.setProperty('filter', `invert(${invert}) grayscale(1) brightness(0%)`) } } @@ -210,7 +210,7 @@ export class VerticalIcons extends Plugin { onThemeChanged (themeType) { const invert = themeType === 'dark' ? 1 : 0 - const active = this.view.querySelector(`.${css.active}`) + const active = this.view.querySelector(`.active`) if (active) { let image = active.querySelector('.image') image.style.setProperty('filter', `invert(${invert})`) diff --git a/src/app/tabs/styles/run-tab-styles.js b/src/app/tabs/styles/run-tab-styles.js index ed1db69455..69fc8b2c9a 100644 --- a/src/app/tabs/styles/run-tab-styles.js +++ b/src/app/tabs/styles/run-tab-styles.js @@ -2,7 +2,6 @@ var csjs = require('csjs-inject') var css = csjs` .runTabView { - padding: 2%; display: flex; flex-direction: column; } diff --git a/src/app/udapp/run-tab.js b/src/app/udapp/run-tab.js index 47c3d1a4d4..6856a94753 100644 --- a/src/app/udapp/run-tab.js +++ b/src/app/udapp/run-tab.js @@ -74,7 +74,7 @@ export class RunTab extends LibraryPlugin { } renderContainer () { - this.container = yo`
` + this.container = yo`
` var el = yo`
diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index 1f4040ca3a..9edd232f1d 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -3,7 +3,7 @@ const csjs = require('csjs-inject') const css = csjs` .dragbar { - width : 0.5em; + width : 4px; height : 100%; cursor : col-resize; z-index : 999; From 7c039a7eca01c499923a32293962f5d8e14b3f03 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 8 Aug 2019 16:06:39 +0200 Subject: [PATCH 3/5] remove manual resiing of panels --- src/app.js | 2 +- src/lib/panels-resize.js | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/app.js b/src/app.js index a77f3b7e54..a63821319b 100644 --- a/src/app.js +++ b/src/app.js @@ -141,7 +141,7 @@ class App { init () { var self = this - self._components.resizeFeature = new PanelsResize('#side-panel', '#editor-container', { 'minWidth': 300, x: 450 }) + self._components.resizeFeature = new PanelsResize('#side-panel', '#editor-container', { 'minWidth': 330, x: 450 }) run.apply(self) } diff --git a/src/lib/panels-resize.js b/src/lib/panels-resize.js index 9edd232f1d..a32006866f 100644 --- a/src/lib/panels-resize.js +++ b/src/lib/panels-resize.js @@ -99,20 +99,10 @@ export default class PanelsResize { } minimize () { - let panel1Width = 0 - let panel2left = this.panel1.offsetLeft + panel1Width - let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width - this.panel1.style.width = panel1Width + 'px' - this.panel2.style.left = panel2left + 'px' - this.panel2.style.width = panel2Width + 'px' + this.panel1.style.display = 'none' } maximise () { - let panel1Width = this.opt.minWidth - let panel2left = this.panel1.offsetLeft + panel1Width - let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width - this.panel1.style.width = panel1Width + 'px' - this.panel2.style.left = panel2left + 'px' - this.panel2.style.width = panel2Width + 'px' + this.panel1.style.display = 'flex' } } From 7706731821d48883f8f6127132a29232de68418f Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 13 Aug 2019 12:28:00 +0200 Subject: [PATCH 4/5] removed second item of deployed contract at address --- src/app/tabs/runTab/model/dropdownlogic.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/tabs/runTab/model/dropdownlogic.js b/src/app/tabs/runTab/model/dropdownlogic.js index f60ab0dd49..2c90db2920 100644 --- a/src/app/tabs/runTab/model/dropdownlogic.js +++ b/src/app/tabs/runTab/model/dropdownlogic.js @@ -54,8 +54,9 @@ class DropdownLogic { } cb(null, 'abi', abi) }) + } else { + cb(null, 'instance') } - cb(null, 'instance') } getCompiledContracts (compiler, compilerFullName) { From db55f8f3a00b9eccac8dec9db9d225288bdab611 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Tue, 13 Aug 2019 12:29:36 +0200 Subject: [PATCH 5/5] fixed the title of deployed to address --- src/app/udapp/run-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/udapp/run-tab.js b/src/app/udapp/run-tab.js index 6856a94753..2dd196146d 100644 --- a/src/app/udapp/run-tab.js +++ b/src/app/udapp/run-tab.js @@ -133,7 +133,7 @@ export class RunTab extends LibraryPlugin { if (noInstancesText.parentNode) { noInstancesText.parentNode.removeChild(noInstancesText) } }) this.contractDropdownUI.event.register('newContractABIAdded', (abi, address) => { - this.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, address)) + this.instanceContainer.appendChild(udappUI.renderInstanceFromABI(abi, address, '')) }) this.contractDropdownUI.event.register('newContractInstanceAdded', (contractObject, address, value) => { this.instanceContainer.appendChild(udappUI.renderInstance(contractObject, address, value))