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