From 38ed29327ea8fddaa33d1d5a6964e242b1ffc937 Mon Sep 17 00:00:00 2001 From: STEINNI Date: Fri, 10 Apr 2026 14:35:01 +0000 Subject: [PATCH] subflow can take js objects or url --- bzGraflow.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bzGraflow.js b/bzGraflow.js index 665faeb..1eb2c91 100644 --- a/bzGraflow.js +++ b/bzGraflow.js @@ -230,14 +230,18 @@ class BZgraflow extends Buildoz{ // scaled down so it fits exactly inside the clicked node, then animate it to full size. const nodeBB = nodeEl.getBoundingClientRect() const parentBB = this.getBoundingClientRect() - const flowNode = this.flow?.nodes?.find(n => n.id === id) - const flowUrl = flowNode.subflow.url const childEl = document.createElement('bz-graflow') childEl.isSubflow = true childEl.currentOrientation = this.currentOrientation - childEl.setAttribute('flow', flowUrl) + if(flowNode.subflow.url) childEl.setAttribute('flow', flowNode.subflow.url) + else { + childEl.addEventListener('bz:graflow:domConnected', (e) => { + e.detail.graflow.loadFlow(flowNode.subflow.flow) + }) + } + childEl.setAttribute('tension', this.getBZAttribute('tension') || '60') // Remember which node we "came from" so exitSubflow() can animate back to it. childEl.dataset.enterNodeId = id