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:
parent
637e280dec
commit
81050184eb
1 changed files with 3 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue