Unverified Commit 88da6160 authored by Liana Husikyan's avatar Liana Husikyan Committed by GitHub

Merge pull request #2204 from ethereum/toasterIssue

resizable buttons for deploy&run -> contract functions
parents 14d14a0a 24345e28
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -107,10 +107,18 @@ class ContractDropdownUI { ...@@ -107,10 +107,18 @@ class ContractDropdownUI {
return return
} }
var selectedContract = this.getSelectedContract() const selectedContract = this.getSelectedContract()
var createConstructorInstance = new MultiParamManager(0, selectedContract.getConstructorInterface(), (valArray, inputsValues) => { const clickCallback = (valArray, inputsValues) => {
this.createInstance(inputsValues) this.createInstance(inputsValues)
}, selectedContract.getConstructorInputs(), 'Deploy', selectedContract.bytecodeObject) }
const createConstructorInstance = new MultiParamManager(
0,
selectedContract.getConstructorInterface(),
clickCallback,
selectedContract.getConstructorInputs(),
'Deploy',
selectedContract.bytecodeObject
)
this.createPanel.appendChild(createConstructorInstance.render()) this.createPanel.appendChild(createConstructorInstance.render())
} }
......
...@@ -107,6 +107,9 @@ var css = csjs` ...@@ -107,6 +107,9 @@ var css = csjs`
flex-direction: row; flex-direction: row;
align-items: baseline; align-items: baseline;
} }
.button button{
flex: none;
}
.button { .button {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -119,6 +119,7 @@ class MultiParamManager { ...@@ -119,6 +119,7 @@ class MultiParamManager {
this.basicInputField = yo`<input></input>` this.basicInputField = yo`<input></input>`
this.basicInputField.setAttribute('placeholder', this.inputs) this.basicInputField.setAttribute('placeholder', this.inputs)
this.basicInputField.setAttribute('title', this.inputs) this.basicInputField.setAttribute('title', this.inputs)
this.basicInputField.setAttribute('style', 'flex: 4')
var onClick = (domEl) => { var onClick = (domEl) => {
this.clickCallBack(this.funABI.inputs, this.basicInputField.value) this.clickCallBack(this.funABI.inputs, this.basicInputField.value)
...@@ -127,9 +128,14 @@ class MultiParamManager { ...@@ -127,9 +128,14 @@ class MultiParamManager {
// otherwise it needs to have btn-warning injected // otherwise it needs to have btn-warning injected
// or do we need to only do this in 1 place - I have a feeling that this will happen in multiple places // or do we need to only do this in 1 place - I have a feeling that this will happen in multiple places
this.contractActionsContainerSingle = yo`<div class="${css.contractActionsContainerSingle}" > this.contractActionsContainerSingle = yo`
<button onclick=${() => { onClick() }} class="${css.instanceButton} btn btn-sm">${title}</button>${this.basicInputField}<i class="fas fa-angle-down ${css.methCaret}" onclick=${() => { this.switchMethodViewOn() }} title=${title} ></i> <div class="${css.contractActionsContainerSingle}" >
</div>` <button onclick=${() => onClick()} class="${css.instanceButton} btn btn-sm">
${title}
</button>
${this.basicInputField}
<i class="fas fa-angle-down ${css.methCaret}" onclick=${() => this.switchMethodViewOn()} title=${title} ></i>
</div>`
this.multiFields = this.createMultiFields() this.multiFields = this.createMultiFields()
...@@ -195,7 +201,7 @@ class MultiParamManager { ...@@ -195,7 +201,7 @@ class MultiParamManager {
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden'
} else { } else {
this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden' this.contractActionsContainerSingle.querySelector('i').style.visibility = 'hidden'
this.basicInputField.style.display = 'none' this.basicInputField.style.visibility = 'hidden'
} }
if (this.funABI.payable === true) { if (this.funABI.payable === true) {
......
...@@ -97,6 +97,7 @@ var css = csjs` ...@@ -97,6 +97,7 @@ var css = csjs`
} }
.instanceButton { .instanceButton {
border-radius: 3px; border-radius: 3px;
flex: 3;
} }
.closeIcon { .closeIcon {
font-size: 12px; font-size: 12px;
...@@ -109,7 +110,6 @@ var css = csjs` ...@@ -109,7 +110,6 @@ var css = csjs`
justify-content: flex-end; justify-content: flex-end;
} }
.contractProperty { .contractProperty {
overflow: auto;
margin-bottom: 0.4em; margin-bottom: 0.4em;
margin-top: 1em; margin-top: 1em;
width:100%; width:100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment