From 97fe3735912bf0d2fb7dd089c5a83bf41225f8c9 Mon Sep 17 00:00:00 2001 From: nofunstudio Date: Sun, 2 Feb 2025 23:49:06 -0700 Subject: [PATCH] update iframe dimension --- __pycache__/iframe_view.cpython-312.pyc | Bin 11445 -> 11424 bytes iframe_view.py | 3 +-- js/iframe_view.js | 16 ++++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/__pycache__/iframe_view.cpython-312.pyc b/__pycache__/iframe_view.cpython-312.pyc index 7ce8138530f0f570f2ca55da881b938a4bd3d66b..1a5c4eab4b252333a9e571e756d8ceed78b61686 100644 GIT binary patch delta 389 zcmdlQxge7FG%qg~0}v>OFG!c$$oo}>F=#Tgtez%Q3TGx`8dC~O3Renu3Qr2h9A+So zcMfX`UkZPUz#OI&!8uI944OidV`P0Muaq_CeaQke<|QML$eh49`M>OqFbTyA$_XEs znMB1tu(B!$ec)kGRNG*Eq2!SjRGaE$YfQa15 zVybbBQ#Y5Yeq)lU1Bz&J6jgvE5tSJI1f+<3Cm{Nr2Fa w.name === "url"); + const widthWidget = node.widgets.find((w) => w.name === "width"); + const heightWidget = node.widgets.find((w) => w.name === "height"); + const stateWidget = node.widgets.find((w) => w.name === "scene_state"); + console.log("[widgetIframe] Initializing iframe widget for node:", node); node.isCaptureComplete = false; // Create iframe wrapper with some styling @@ -23,8 +29,8 @@ async function widgetIframe(node, nodeData, inputData, app) { // Create the iframe element const iframe = $el("iframe", { style: { - width: "100%", - height: "100%", + width: widthWidget.value + "px", + height: heightWidget.value + "px", border: "none", }, sandbox: "allow-scripts allow-same-origin allow-forms", @@ -33,12 +39,6 @@ async function widgetIframe(node, nodeData, inputData, app) { iframeWrapper.appendChild(iframe); - // Locate our parameter widgets - const urlWidget = node.widgets.find((w) => w.name === "url"); - const widthWidget = node.widgets.find((w) => w.name === "width"); - const heightWidget = node.widgets.find((w) => w.name === "height"); - const stateWidget = node.widgets.find((w) => w.name === "scene_state"); - // Set initial URL if provided if (urlWidget.value) { iframe.src = urlWidget.value;