From 5161a266155f9c5602f1d70bbbd7a82007a0ab3b Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sat, 2 Mar 2024 05:15:06 +0200 Subject: Broke out function onWindowResize --- src/js/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 11b9658..610417b 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -11,14 +11,15 @@ pageLayout.height = window.innerHeight; mainContainer.style.display = 'block'; window.innerWidth <= 770 ? isMobile = true : isMobile = false; isMobile ? doubleFloorMenu.style.display = 'none':doubleFloorMenu.style.display = 'flex'; -window.addEventListener('resize', () => { +function onWindowResize(){ body.width = window.innerWidth; body.height = window.innerHeight; pageLayout.width = window.innerWidth; pageLayout.height = window.innerHeight; window.innerWidth <= 770 ? isMobile = true : isMobile = false; isMobile ? doubleFloorMenu.style.display = 'none':doubleFloorMenu.style.display = 'flex'; -}) +} +window.addEventListener('resize', onWindowResize, false); // And call menuinit(); -- cgit v1.2.3