1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

Fix detecting if mobile css layout is enabled

Use matchMedia to check if mobile css is enabled instead of checking window innerwidth size.
This commit is contained in:
Alain Takoudjou 2021-03-28 22:29:04 +02:00 committed by Juliusz Chroboczek
parent 637e280dec
commit 81050184eb

View file

@ -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;
}
/**