[DE] fix Device.android flag

This commit is contained in:
Maxim Kadushkin 2020-10-09 23:05:45 +03:00
parent 738e0bf2b5
commit 24d95468e3

View file

@ -28,6 +28,11 @@
</head> </head>
<body> <body>
<script> <script>
const isAndroid = /Android/.test(navigator.userAgent);
if ( isAndroid && navigator.platform == 'Win32' )
// Framework7 doesn't set Device.android flag when navigator.platform == 'Win32', change it for debug
navigator.__defineGetter__('platform', () => 'Win32Debug');
const getUrlParams = () => { const getUrlParams = () => {
let e, let e,
a = /\+/g, // Regex for replacing addition symbol with a space a = /\+/g, // Regex for replacing addition symbol with a space
@ -53,7 +58,7 @@
logo = /*params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : */null, logo = /*params["headerlogo"] ? encodeUrlParam(params["headerlogo"]) : */null,
logoOO = null; logoOO = null;
if (!logo) { if (!logo) {
logoOO = /Android/.test(navigator.userAgent) ? "../../common/mobile/resources/img/header/header-logo-android.png" : "../../common/mobile/resources/img/header/header-logo-ios.png"; logoOO = isAndroid ? "../../common/mobile/resources/img/header/header-logo-android.png" : "../../common/mobile/resources/img/header/header-logo-ios.png";
} }
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
@ -62,7 +67,7 @@
let brendpanel = document.getElementsByClassName('brendpanel')[0]; let brendpanel = document.getElementsByClassName('brendpanel')[0];
if (brendpanel) { if (brendpanel) {
if (/Android/.test(navigator.userAgent)) { if ( isAndroid ) {
brendpanel.classList.add('android'); brendpanel.classList.add('android');
} }
brendpanel.classList.add('visible'); brendpanel.classList.add('visible');
@ -74,7 +79,7 @@
elem.style.opacity = 1; elem.style.opacity = 1;
} }
var placeholder = document.getElementsByClassName('placeholder')[0]; var placeholder = document.getElementsByClassName('placeholder')[0];
if (placeholder && /Android/.test(navigator.userAgent)) { if (placeholder && isAndroid) {
placeholder.classList.add('android'); placeholder.classList.add('android');
} }
} }