Added checkbox activation of publish

pull/5370/head
ioedeveloper 5 years ago
parent df8ac5ec1f
commit 4dbf6c8108
  1. 12
      src/app/tabs/runTab/contractDropdown.js

@ -43,14 +43,10 @@ class ContractDropdownUI {
this.compFails.style.display = 'block' this.compFails.style.display = 'block'
document.querySelector(`.${css.contractNames}`).classList.add(css.contractNamesError) document.querySelector(`.${css.contractNames}`).classList.add(css.contractNamesError)
} }
this.ipfsCheckedState = false
}) })
} }
updateCheckedState () {
this.ipfsCheckedState = !this.ipfsCheckedState
console.log('this.ipfsCheckedState: ', this.ipfsCheckedState)
}
render () { render () {
this.compFails = yo`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="m-1 fas fa-times-circle ${css.errorIcon}" ></i>` this.compFails = yo`<i title="No contract compiled yet or compilation failed. Please check the compile tab for more information." class="m-1 fas fa-times-circle ${css.errorIcon}" ></i>`
var info = yo`<i class="fas fa-info ${css.infoDeployAction}" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>` var info = yo`<i class="fas fa-info ${css.infoDeployAction}" aria-hidden="true" title="*.sol files allows deploying and accessing contracts. *.abi files only allows accessing contracts."></i>`
@ -61,11 +57,13 @@ class ContractDropdownUI {
this.createPanel = yo`<div class="${css.deployDropdown}"></div>` this.createPanel = yo`<div class="${css.deployDropdown}"></div>`
this.orLabel = yo`<div class="${css.orLabel}">or</div>` this.orLabel = yo`<div class="${css.orLabel}">or</div>`
const ipfsCheckbox = this.ipfsCheckedState ? const ipfsCheckbox = this.ipfsCheckedState ?
yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" onchange=${this.updateCheckedState}>` yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" />`
: :
yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => { yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => {
this.updateCheckedState() if(!this.ipfsCheckedState){
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.call(this)) publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.call(this))
this.ipfsCheckedState = true
}
}}>` }}>`
let el = yo` let el = yo`

Loading…
Cancel
Save