From 88074b914404db8af716cc7a8e04c7c4d1ce3397 Mon Sep 17 00:00:00 2001 From: STEINNI Date: Mon, 13 Apr 2026 07:45:31 +0000 Subject: [PATCH] graflow: cleanup in subflow child params inheritance --- bzGraflow.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bzGraflow.js b/bzGraflow.js index ba3bb1e..77be0bc 100644 --- a/bzGraflow.js +++ b/bzGraflow.js @@ -235,6 +235,10 @@ class BZgraflow extends Buildoz{ const childEl = document.createElement('bz-graflow') childEl.isSubflow = true 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) => { 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 }) if(flowNode.subflow.url) childEl.setAttribute('flow', flowNode.subflow.url) @@ -280,8 +284,6 @@ class BZgraflow extends Buildoz{ this.invade(this, childEl) childEl.hostContainer.appendChild(btnExitSubflow) -///////////////////// - // Fade out the current (host) graflow while the child scales up this.hostContainer.style.opacity = '1' this.hostContainer.style.transition = 'opacity 1000ms ease-in-out' @@ -660,7 +662,8 @@ class BZgraflow extends Buildoz{ 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(gapy == null) gapy = parseInt(this.getBZAttribute('gapy')) || 80 if(tween == null) tween = parseInt(this.getBZAttribute('tween')) || 500