Added checkbox activation of publish

pull/1/head
ioedeveloper 5 years ago
parent fca065ae80
commit 3ddce10c72
  1. 16
      src/app/tabs/runTab/contractDropdown.js

@ -43,14 +43,10 @@ class ContractDropdownUI {
this.compFails.style.display = 'block'
document.querySelector(`.${css.contractNames}`).classList.add(css.contractNamesError)
}
this.ipfsCheckedState = false
})
}
updateCheckedState () {
this.ipfsCheckedState = !this.ipfsCheckedState
console.log('this.ipfsCheckedState: ', this.ipfsCheckedState)
}
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>`
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>`
@ -60,12 +56,14 @@ class ContractDropdownUI {
this.createPanel = yo`<div class="${css.deployDropdown}"></div>`
this.orLabel = yo`<div class="${css.orLabel}">or</div>`
const ipfsCheckbox = this.ipfsCheckedState ?
yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" onchange=${this.updateCheckedState}>`
const ipfsCheckbox = this.ipfsCheckedState ?
yo`<input id="deployAndRunPublishToIPFS" checked class="mr-2" type="checkbox" />`
:
yo`<input id="deployAndRunPublishToIPFS" class="mr-2" type="checkbox" onchange=${() => {
this.updateCheckedState()
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.call(this))
if(!this.ipfsCheckedState){
publishToStorage('ipfs', this.runView.fileProvider, this.runView.fileManager, this.getSelectedContract.call(this))
this.ipfsCheckedState = true
}
}}>`
let el = yo`

Loading…
Cancel
Save