Commit 81050184 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Juliusz Chroboczek

Fix detecting if mobile css layout is enabled

Use matchMedia to check if mobile css is enabled instead of checking window innerwidth size.
parent 637e280d
......@@ -40,12 +40,6 @@ let serverConnection;
let fallbackUserPass = null;
/* max-device-width which is defined in css for mobile layout */
/**
* @type {number}
*/
let mobileViewportWidth = 1024;
/**
* @param {string} username
* @param {string} password
......@@ -260,8 +254,9 @@ function reflectSettings() {
}
function isMobileLayout() {
let width = window.innerWidth;
return width <= mobileViewportWidth;
if (window.matchMedia('only screen and (max-width: 1024px)').matches)
return true;
return false;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment