graflow: cleanup in subflow child params inheritance

This commit is contained in:
STEINNI
2026-04-13 07:45:31 +00:00
parent 7090bf7a3a
commit 88074b9144
+7 -4
View File
@@ -235,6 +235,10 @@ class BZgraflow extends Buildoz{
const childEl = document.createElement('bz-graflow') const childEl = document.createElement('bz-graflow')
childEl.isSubflow = true childEl.isSubflow = true
childEl.currentOrientation = this.currentOrientation childEl.currentOrientation = this.currentOrientation
const inheritedAttrs = ['orientation', 'gapx', 'gapy', 'tween', 'align', 'tension', 'wiretype', 'edit']
for(const attrName of inheritedAttrs){
if(this.hasAttribute(attrName)) childEl.setAttribute(attrName, this.getAttribute(attrName))
}
childEl.addEventListener('bz:graflow:flowLoaded', (e) => { childEl.addEventListener('bz:graflow:flowLoaded', (e) => {
for(const portLink of flowNode.subflow.portLinks){ for(const portLink of flowNode.subflow.portLinks){
@@ -257,7 +261,7 @@ class BZgraflow extends Buildoz{
} }
} }
childEl.autoPlace(this.currentOrientation, parseInt(this.getBZAttribute('gapx')) || 80, parseInt(this.getBZAttribute('gapy')) || 80) childEl.autoPlace()
}, { once:true }) }, { once:true })
if(flowNode.subflow.url) childEl.setAttribute('flow', flowNode.subflow.url) if(flowNode.subflow.url) childEl.setAttribute('flow', flowNode.subflow.url)
@@ -280,8 +284,6 @@ class BZgraflow extends Buildoz{
this.invade(this, childEl) this.invade(this, childEl)
childEl.hostContainer.appendChild(btnExitSubflow) childEl.hostContainer.appendChild(btnExitSubflow)
/////////////////////
// Fade out the current (host) graflow while the child scales up // Fade out the current (host) graflow while the child scales up
this.hostContainer.style.opacity = '1' this.hostContainer.style.opacity = '1'
this.hostContainer.style.transition = 'opacity 1000ms ease-in-out' this.hostContainer.style.transition = 'opacity 1000ms ease-in-out'
@@ -660,7 +662,8 @@ class BZgraflow extends Buildoz{
return(path) return(path)
} }
autoPlace(orientation = 'horizontal', gapx = null, gapy = null, tween = null, align = null){ autoPlace(orientation = null, gapx = null, gapy = null, tween = null, align = null){
if(orientation == null) orientation = this.getBZAttribute('orientation') || this.currentOrientation || 'horizontal'
if(gapx == null) gapx = parseInt(this.getBZAttribute('gapx')) || 80 if(gapx == null) gapx = parseInt(this.getBZAttribute('gapx')) || 80
if(gapy == null) gapy = parseInt(this.getBZAttribute('gapy')) || 80 if(gapy == null) gapy = parseInt(this.getBZAttribute('gapy')) || 80
if(tween == null) tween = parseInt(this.getBZAttribute('tween')) || 500 if(tween == null) tween = parseInt(this.getBZAttribute('tween')) || 500