aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-02 05:15:06 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-03-02 05:15:06 +0200
commit5161a266155f9c5602f1d70bbbd7a82007a0ab3b (patch)
tree2698cb34e02f5e734277adfa04f36e4d3deb80a2
parent607feaa5ead100ef675eb4c540fcf022835500d0 (diff)
downloadarching-kaos-web-ui-5161a266155f9c5602f1d70bbbd7a82007a0ab3b.tar.gz
arching-kaos-web-ui-5161a266155f9c5602f1d70bbbd7a82007a0ab3b.tar.bz2
arching-kaos-web-ui-5161a266155f9c5602f1d70bbbd7a82007a0ab3b.zip
Broke out function onWindowResize
-rw-r--r--src/js/app.js5
1 files 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();