graflow: disabled attribute
This commit is contained in:
@@ -98,6 +98,28 @@ class BZgraflow extends Buildoz{
|
|||||||
else this.initFlow()
|
else this.initFlow()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get observedAttributes(){
|
||||||
|
return([...super.observedAttributes, 'disabled'])
|
||||||
|
}
|
||||||
|
|
||||||
|
attributeChangedCallback(name, oldValue, newValue) {
|
||||||
|
super.attributeChangedCallback(name, oldValue, newValue)
|
||||||
|
if(name == 'disabled'){
|
||||||
|
if(newValue === null) {
|
||||||
|
this.disabled = false
|
||||||
|
this.style.opacity = 1
|
||||||
|
this.style.pointerEvents = 'auto'
|
||||||
|
} else {
|
||||||
|
this.disabled = true
|
||||||
|
this.style.opacity = 0.5
|
||||||
|
this.style.pointerEvents = 'none'
|
||||||
|
}
|
||||||
|
this.querySelectorAll('.bzgf-zoom-in, .bzgf-zoom-out').forEach((btn) => {
|
||||||
|
btn.disabled = this.disabled
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
error(msg, err){
|
error(msg, err){
|
||||||
this.querySelector('.graflow-error')?.remove()
|
this.querySelector('.graflow-error')?.remove()
|
||||||
const errorEl = document.createElement('div')
|
const errorEl = document.createElement('div')
|
||||||
@@ -227,6 +249,7 @@ class BZgraflow extends Buildoz{
|
|||||||
}
|
}
|
||||||
|
|
||||||
enterSubflow(id){
|
enterSubflow(id){
|
||||||
|
if(this.disabled || this.hasAttribute('disabled')) return
|
||||||
const nodeEl = this.stagedNodes[id]
|
const nodeEl = this.stagedNodes[id]
|
||||||
if(!nodeEl) return
|
if(!nodeEl) return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user