resizable buttons for deploy&run -> contract functions

pull/3094/head
LianaHus 5 years ago
parent bf5bf52b6a
commit 0919c1a34d
  1. 11
      src/app/tabs/runTab/contractDropdown.js
  2. 3
      src/app/tabs/styles/run-tab-styles.js
  3. 12
      src/app/ui/multiParamManager.js
  4. 1
      src/universal-dapp-styles.js

@ -108,9 +108,16 @@ class ContractDropdownUI {
} }
var selectedContract = this.getSelectedContract() var selectedContract = this.getSelectedContract()
var createConstructorInstance = new MultiParamManager(0, selectedContract.getConstructorInterface(), (valArray, inputsValues) => { var createConstructorInstance = new MultiParamManager(
0,
selectedContract.getConstructorInterface(),
(valArray, inputsValues) => {
this.createInstance(inputsValues) this.createInstance(inputsValues)
}, selectedContract.getConstructorInputs(), 'Deploy', selectedContract.bytecodeObject) },
selectedContract.getConstructorInputs(),
'Deploy',
selectedContract.bytecodeObject
)
this.createPanel.appendChild(createConstructorInstance.render()) this.createPanel.appendChild(createConstructorInstance.render())
} }

@ -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 {
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,8 +128,13 @@ 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}" >
<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>` </div>`
this.multiFields = this.createMultiFields() this.multiFields = this.createMultiFields()
@ -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`
} }
.instanceButton { .instanceButton {
border-radius: 3px; border-radius: 3px;
flex: 3;
} }
.closeIcon { .closeIcon {
font-size: 12px; font-size: 12px;

Loading…
Cancel
Save