diff --git a/src/routes/idaa/(idaa)/+layout.svelte b/src/routes/idaa/(idaa)/+layout.svelte index 3b438026..5fca968c 100644 --- a/src/routes/idaa/(idaa)/+layout.svelte +++ b/src/routes/idaa/(idaa)/+layout.svelte @@ -94,8 +94,10 @@ if (browser && iframe == 'true') { -$: if ($ae_loc.iframe_height && $ae_loc.iframe_height_modal_body) { - console.log('getting new dimensions for iframe:', $ae_loc.iframe_height, $ae_loc.iframe_height_modal_body); +$: if ($ae_loc.iframe && $ae_loc.iframe_height && $ae_loc.iframe_height_modal_body) { + if (log_lvl > 1) { + console.log('Getting new dimensions for iframe with modal:', $ae_loc.iframe_height, $ae_loc.iframe_height_modal_body); + } let iframe_height = 0; @@ -115,13 +117,14 @@ $: if ($ae_loc.iframe_height && $ae_loc.iframe_height_modal_body) { // iframe_height = iframe_height + 50; // Just in case } - console.log(`Suggested new iframe_height: ${iframe_height}`); + if (log_lvl > 1) { + console.log(`Suggested new iframe_height with modal: ${iframe_height}`); + } window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels -} else if ($ae_loc.iframe_height) { - console.log('setting new iframe_height:', $ae_loc.iframe_height); - - // let iframe_height = $ae_loc.iframe_height; - +} else if ($ae_loc.iframe && $ae_loc.iframe_height) { + if (log_lvl > 1) { + console.log('Suggested new iframe_height:', $ae_loc.iframe_height); + } window.parent.postMessage({'iframe_height': $ae_loc.iframe_height}, "*"); // This should be in pixels }