Commit 3ddce10c authored by ioedeveloper's avatar ioedeveloper

Added checkbox activation of publish

parent fca065ae
...@@ -43,14 +43,10 @@ class ContractDropdownUI { ...@@ -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>`
...@@ -60,12 +56,14 @@ class ContractDropdownUI { ...@@ -60,12 +56,14 @@ 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`
......
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