Work on general layout improvements. Making special cases for Safari browsers.

This commit is contained in:
Scott Idem
2025-06-26 20:41:25 -04:00
parent 4ef2e7cd6b
commit bd0d96cb83
3 changed files with 17 additions and 7 deletions

View File

@@ -172,11 +172,11 @@ $effect(() => {
// console.log(`idaa_root_layout.svelte: data:`, data);
// }
// // If the browser is Safari, we need to handle the scroll differently
// if (is_safari) {
// console.log('Safari detected, using special scroll handling');
// // Add any Safari-specific logic here if needed
// }
// If the browser is Safari, we need to handle the scroll differently
if (is_safari) {
console.log('Safari detected, using special scroll handling');
$ae_loc.browser_type = 'safari';
}
// // Initial scroll position
// scroll_y = scroll_container().scrollTop;
@@ -373,10 +373,14 @@ $effect(() => {
}
// var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
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);
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 {
console.log('Not Safari, using smooth scroll to top');
document.getElementById('ae_idaa')?.scrollTo({