Salvataggio modifiche correnti prima di implementare condivisione canto
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user