Work on general layout improvements. Making special cases for Safari browsers.
This commit is contained in:
@@ -65,6 +65,7 @@ const ae_app_local_data_defaults: key_val = {
|
|||||||
theme_mode: 'light',
|
theme_mode: 'light',
|
||||||
theme_name: 'nouveau', // wintry
|
theme_name: 'nouveau', // wintry
|
||||||
iframe: false,
|
iframe: false,
|
||||||
|
browser_type: null, // Safari needs help with scrolling correctly in iframes.
|
||||||
title: `OSIT's Æ`, // - Dev SvelteKit`, // Æ
|
title: `OSIT's Æ`, // - Dev SvelteKit`, // Æ
|
||||||
|
|
||||||
debug_menu: false, // Flag show debug menu.
|
debug_menu: false, // Flag show debug menu.
|
||||||
|
|||||||
@@ -173,6 +173,11 @@ function add_activity_log(
|
|||||||
let message = {'event_id': idaa_event_obj?.event_id};
|
let message = {'event_id': idaa_event_obj?.event_id};
|
||||||
window.parent.postMessage(message, "*");
|
window.parent.postMessage(message, "*");
|
||||||
|
|
||||||
|
if ($ae_loc?.iframe && $ae_loc.browser_type == 'safari') {
|
||||||
|
console.log('In Safari iframe, sending message to parent window to scroll to top as well');
|
||||||
|
window.parent.postMessage({'scroll_to': 0}, "*"); // This should be in pixels
|
||||||
|
}
|
||||||
|
|
||||||
// $idaa_sess.recovery_meetings.show_main__options = true;
|
// $idaa_sess.recovery_meetings.show_main__options = true;
|
||||||
// $idaa_sess.recovery_meetings.show_list__event_obj_li = true;
|
// $idaa_sess.recovery_meetings.show_list__event_obj_li = true;
|
||||||
$idaa_trig.event_id = true;
|
$idaa_trig.event_id = true;
|
||||||
|
|||||||
@@ -172,11 +172,11 @@ $effect(() => {
|
|||||||
// console.log(`idaa_root_layout.svelte: data:`, data);
|
// console.log(`idaa_root_layout.svelte: data:`, data);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// // If the browser is Safari, we need to handle the scroll differently
|
// If the browser is Safari, we need to handle the scroll differently
|
||||||
// if (is_safari) {
|
if (is_safari) {
|
||||||
// console.log('Safari detected, using special scroll handling');
|
console.log('Safari detected, using special scroll handling');
|
||||||
// // Add any Safari-specific logic here if needed
|
$ae_loc.browser_type = 'safari';
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // Initial scroll position
|
// // Initial scroll position
|
||||||
// scroll_y = scroll_container().scrollTop;
|
// scroll_y = scroll_container().scrollTop;
|
||||||
@@ -373,10 +373,14 @@ $effect(() => {
|
|||||||
}
|
}
|
||||||
// var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
// var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
||||||
if (is_safari) {
|
if (is_safari) {
|
||||||
console.log('Safari detected, not using smooth scroll to top');
|
console.log('Safari detected, not using smooth scroll to top.');
|
||||||
document.getElementById('ae_idaa')?.scrollTo(0, 0);
|
document.getElementById('ae_idaa')?.scrollTo(0, 0);
|
||||||
|
|
||||||
window.parent.postMessage({'scroll_to': 0}, "*"); // This should be in pixels
|
if ($ae_loc?.iframe) {
|
||||||
|
// If in iframe, we need to send a message to the parent window to scroll to top
|
||||||
|
console.log('In Safari iframe, sending message to parent window to scroll to top as well');
|
||||||
|
window.parent.postMessage({'scroll_to': 0}, "*"); // This should be in pixels
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Not Safari, using smooth scroll to top');
|
console.log('Not Safari, using smooth scroll to top');
|
||||||
document.getElementById('ae_idaa')?.scrollTo({
|
document.getElementById('ae_idaa')?.scrollTo({
|
||||||
|
|||||||
Reference in New Issue
Block a user