Dealing with iframes. postMessage to parent iframe when certain things are opened/viewed.
This commit is contained in:
@@ -91,6 +91,9 @@ $: lq__archive_content_obj = liveQuery(async () => {
|
|||||||
|
|
||||||
if (browser) {
|
if (browser) {
|
||||||
console.log('Browser environment detected.');
|
console.log('Browser environment detected.');
|
||||||
|
|
||||||
|
let message = {'archive_id': $idaa_slct?.archive_id};
|
||||||
|
window.parent.postMessage(message, "*");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ let ae_promises: key_val = {};
|
|||||||
$idaa_slct.archive_content_id = idaa_archive_content_obj?.archive_content_id;
|
$idaa_slct.archive_content_id = idaa_archive_content_obj?.archive_content_id;
|
||||||
$idaa_slct.archive_content_obj = idaa_archive_content_obj;
|
$idaa_slct.archive_content_obj = idaa_archive_content_obj;
|
||||||
|
|
||||||
|
let message = {'archive_content_id': $idaa_slct?.archive_content_id};
|
||||||
|
window.parent.postMessage(message, "*");
|
||||||
|
|
||||||
// handle_load_post_comment_obj_li({archive_id: $idaa_slct.archive_id, try_cache: false});
|
// handle_load_post_comment_obj_li({archive_id: $idaa_slct.archive_id, try_cache: false});
|
||||||
|
|
||||||
// const url = new URL(location);
|
// const url = new URL(location);
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ file_icons['zip'] = 'file-archive';
|
|||||||
$: if (browser && $lq__archive_content_obj?.archive_content_id) {
|
$: if (browser && $lq__archive_content_obj?.archive_content_id) {
|
||||||
console.log('** Component Mounted: ** Media Player - Archive Content Obj');
|
console.log('** Component Mounted: ** Media Player - Archive Content Obj');
|
||||||
|
|
||||||
|
document.body.scrollIntoView();
|
||||||
|
|
||||||
const url = new URL(location);
|
const url = new URL(location);
|
||||||
url.searchParams.set('archive_content_id', $lq__archive_content_obj?.archive_content_id);
|
url.searchParams.set('archive_content_id', $lq__archive_content_obj?.archive_content_id);
|
||||||
// url.searchParams.set('archive_content_id', $idaa_slct?.archive_content_id);
|
// url.searchParams.set('archive_content_id', $idaa_slct?.archive_content_id);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ if ($idaa_slct.post_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: if (browser && $lq__post_obj?.post_id) {
|
$: if (browser && $lq__post_obj?.post_id) {
|
||||||
console.log('** Component Mounted: ** View - Post Obj');
|
document.body.scrollIntoView();
|
||||||
|
|
||||||
const url = new URL(location);
|
const url = new URL(location);
|
||||||
url.searchParams.set('post_id', $lq__post_obj?.post_id);
|
url.searchParams.set('post_id', $lq__post_obj?.post_id);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export let log_lvl = 1;
|
|||||||
// *** Import Svelte core
|
// *** Import Svelte core
|
||||||
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
import { createEventDispatcher, onDestroy, onMount } from 'svelte';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
import { browser } from '$app/environment';
|
||||||
// import Editor from '@tinymce/tinymce-svelte';
|
// import Editor from '@tinymce/tinymce-svelte';
|
||||||
|
|
||||||
import type { key_val } from '$lib/ae_stores';
|
import type { key_val } from '$lib/ae_stores';
|
||||||
@@ -25,6 +26,10 @@ let disable_submit_btn = true;
|
|||||||
|
|
||||||
let event_location_select_option_li = {}; // This is a list (dict) of key value pairs
|
let event_location_select_option_li = {}; // This is a list (dict) of key value pairs
|
||||||
|
|
||||||
|
$: if (browser) {
|
||||||
|
document.body.scrollIntoView();
|
||||||
|
}
|
||||||
|
|
||||||
if ($idaa_slct.event_id) {
|
if ($idaa_slct.event_id) {
|
||||||
// console.log(`Event ID selected: ${$idaa_slct.event_id}`);
|
// console.log(`Event ID selected: ${$idaa_slct.event_id}`);
|
||||||
// console.log(`Event Object selected: ${$lq__event_obj}`)
|
// console.log(`Event Object selected: ${$lq__event_obj}`)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ if ($idaa_slct.event_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$: if (browser && $lq__event_obj?.event_id) {
|
$: if (browser && $lq__event_obj?.event_id) {
|
||||||
|
document.body.scrollIntoView();
|
||||||
|
|
||||||
const url = new URL(location);
|
const url = new URL(location);
|
||||||
url.searchParams.set('event_id', $lq__event_obj?.event_id);
|
url.searchParams.set('event_id', $lq__event_obj?.event_id);
|
||||||
history.pushState({}, '', url);
|
history.pushState({}, '', url);
|
||||||
|
|||||||
Reference in New Issue
Block a user