Fix wrong viewport height on login iOS

This commit is contained in:
Eduard Kuzmenko 2021-02-27 16:03:21 +04:00
parent 5b63730b77
commit 13e8bd5085
2 changed files with 29 additions and 24 deletions

View File

@ -5,7 +5,7 @@ export default class Page {
private installed = false; private installed = false;
constructor(className: string, public isAuthPage: boolean, private onFirstMount?: (...args: any[]) => Promise<any> | void, private onMount?: (...args: any[]) => void, public onShown?: () => void) { constructor(className: string, public isAuthPage: boolean, private onFirstMount?: (...args: any[]) => Promise<any> | void, private onMount?: (...args: any[]) => void, public onShown?: () => void) {
this.pageEl = document.body.getElementsByClassName(className)[0] as HTMLDivElement; this.pageEl = document.body.querySelector('.' + className) as HTMLDivElement;
} }
public async mount(...args: any[]) { public async mount(...args: any[]) {

View File

@ -1,5 +1,6 @@
//import {stackBlurImage} from '../lib/StackBlur'; //import {stackBlurImage} from '../lib/StackBlur';
//import appStateManager from "../lib/appManagers/appStateManager"; //import appStateManager from "../lib/appManagers/appStateManager";
import { blurActiveElement } from "../helpers/dom";
import appStateManager from "../lib/appManagers/appStateManager"; import appStateManager from "../lib/appManagers/appStateManager";
import Page from "./page"; import Page from "./page";
@ -13,28 +14,34 @@ let onFirstMount = () => {
m.default.broadcast('im_mount'); m.default.broadcast('im_mount');
}); });
const promise = import('../lib/appManagers/appDialogsManager'); blurActiveElement();
promise.finally(async() => { return new Promise<void>((resolve) => {
//alert('pageIm!'); window.requestAnimationFrame(() => {
const promise = import('../lib/appManagers/appDialogsManager');
//AudioContext && global.navigator && global.navigator.mediaDevices && global.navigator.mediaDevices.getUserMedia && global.WebAssembly; promise.finally(async() => {
//alert('pageIm!');
/* // @ts-ignore resolve();
var AudioContext = globalThis.AudioContext || globalThis.webkitAudioContext;
alert('AudioContext:' + typeof(AudioContext)); //AudioContext && global.navigator && global.navigator.mediaDevices && global.navigator.mediaDevices.getUserMedia && global.WebAssembly;
// @ts-ignore
alert('global.navigator:' + typeof(navigator)); /* // @ts-ignore
alert('navigator.mediaDevices:' + typeof(navigator.mediaDevices)); var AudioContext = globalThis.AudioContext || globalThis.webkitAudioContext;
alert('navigator.mediaDevices.getUserMedia:' + typeof(navigator.mediaDevices?.getUserMedia)); alert('AudioContext:' + typeof(AudioContext));
alert('global.WebAssembly:' + typeof(WebAssembly)); */ // @ts-ignore
alert('global.navigator:' + typeof(navigator));
//(Array.from(document.getElementsByClassName('rp')) as HTMLElement[]).forEach(el => ripple(el)); alert('navigator.mediaDevices:' + typeof(navigator.mediaDevices));
alert('navigator.mediaDevices.getUserMedia:' + typeof(navigator.mediaDevices?.getUserMedia));
const misc = await import("../components/buttonMenuToggle"); alert('global.WebAssembly:' + typeof(WebAssembly)); */
Array.from(document.getElementsByClassName('btn-menu-toggle')).forEach((el) => {
misc.ButtonMenuToggleHandler(el as HTMLElement); //(Array.from(document.getElementsByClassName('rp')) as HTMLElement[]).forEach(el => ripple(el));
const misc = await import("../components/buttonMenuToggle");
Array.from(document.getElementsByClassName('btn-menu-toggle')).forEach((el) => {
misc.ButtonMenuToggleHandler(el as HTMLElement);
});
});
}); });
}) });
//let promise = /* Promise.resolve() */.then(() => {//import('../lib/services').then(services => { //let promise = /* Promise.resolve() */.then(() => {//import('../lib/services').then(services => {
/* fetch('assets/img/camomile.jpg') /* fetch('assets/img/camomile.jpg')
@ -65,8 +72,6 @@ let onFirstMount = () => {
}; };
}); */ }); */
//}); //});
return promise;
}; };
const page = new Page('page-chats', false, onFirstMount); const page = new Page('page-chats', false, onFirstMount);