Saving my work beforeI rename the notes module to journals module. Finally.
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
export let data: any;
|
||||
import { run } from 'svelte/legacy';
|
||||
|
||||
|
||||
|
||||
import { browser } from '$app/environment';
|
||||
import { ae_snip, ae_loc, ae_sess, ae_api, ae_trig, slct, slct_trigger } from '$lib/ae_stores';
|
||||
import { idaa_loc, idaa_sess, idaa_slct } from '$lib/ae_idaa_stores';
|
||||
interface Props {
|
||||
/** @type {import('./$types').LayoutData} */
|
||||
data: any;
|
||||
children?: import('svelte').Snippet;
|
||||
}
|
||||
|
||||
let { data, children }: Props = $props();
|
||||
|
||||
let log_lvl: number = 0;
|
||||
|
||||
@@ -106,39 +115,41 @@ if (browser && iframe == 'true') {
|
||||
|
||||
|
||||
|
||||
$: 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;
|
||||
|
||||
if ($ae_loc.iframe_height > $ae_loc.iframe_height_modal_body) {
|
||||
iframe_height = $ae_loc.iframe_height;
|
||||
} else {
|
||||
iframe_height = $ae_loc.iframe_height_modal_body;
|
||||
|
||||
// console.log($ae_loc.modal_dimensions);
|
||||
|
||||
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.header_height) {
|
||||
iframe_height = iframe_height + $ae_loc.modal_dimensions.header_height;
|
||||
run(() => {
|
||||
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);
|
||||
}
|
||||
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.footer_height) {
|
||||
iframe_height = iframe_height + $ae_loc.modal_dimensions.footer_height;
|
||||
}
|
||||
// iframe_height = iframe_height + 50; // Just in case
|
||||
}
|
||||
|
||||
if (log_lvl > 1) {
|
||||
console.log(`Suggested new iframe_height with modal: ${iframe_height}`);
|
||||
let iframe_height = 0;
|
||||
|
||||
if ($ae_loc.iframe_height > $ae_loc.iframe_height_modal_body) {
|
||||
iframe_height = $ae_loc.iframe_height;
|
||||
} else {
|
||||
iframe_height = $ae_loc.iframe_height_modal_body;
|
||||
|
||||
// console.log($ae_loc.modal_dimensions);
|
||||
|
||||
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.header_height) {
|
||||
iframe_height = iframe_height + $ae_loc.modal_dimensions.header_height;
|
||||
}
|
||||
if ($ae_loc.modal_dimensions && $ae_loc.modal_dimensions.footer_height) {
|
||||
iframe_height = iframe_height + $ae_loc.modal_dimensions.footer_height;
|
||||
}
|
||||
// iframe_height = iframe_height + 50; // Just in case
|
||||
}
|
||||
|
||||
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 && $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
|
||||
}
|
||||
window.parent.postMessage({'iframe_height': iframe_height}, "*"); // This should be in pixels
|
||||
} 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
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -158,7 +169,7 @@ $: if ($ae_loc.iframe && $ae_loc.iframe_height && $ae_loc.iframe_height_modal_bo
|
||||
<div
|
||||
bind:clientHeight={$ae_loc.iframe_height}
|
||||
>
|
||||
<slot />
|
||||
{@render children?.()}
|
||||
</div>
|
||||
{#if $idaa_loc.novi_uuid}
|
||||
<span class="text-sm text-gray-500">
|
||||
|
||||
Reference in New Issue
Block a user