Salvataggio modifiche correnti prima di implementare condivisione canto

This commit is contained in:
David Frassi
2026-06-16 16:14:20 +02:00
parent 1b6e8a1832
commit 2d23dcae83
13 changed files with 401 additions and 69 deletions
+21
View File
@@ -58,6 +58,27 @@ export class AppComponent implements OnInit {
}
async ngOnInit() {
// Add global horizontal scroll support for wheel on horizontal containers
window.addEventListener('wheel', (event: WheelEvent) => {
if (Math.abs(event.deltaY) > 0 && Math.abs(event.deltaX) === 0) {
const path = event.composedPath();
for (const target of path) {
if (target instanceof HTMLElement) {
const style = window.getComputedStyle(target);
const isHorizontalScroll =
(style.overflowX === 'auto' || style.overflowX === 'scroll') &&
target.scrollWidth > target.clientWidth;
if (isHorizontalScroll) {
target.scrollLeft += event.deltaY;
event.preventDefault();
break;
}
}
}
}
}, { passive: false });
// 1. Allineamento istantaneo alla versione remota
if ((window as any).PwaLoader) {
(window as any).PwaLoader.update({