to:sync
This commit is contained in:
parent
3535839f16
commit
41a1a867fc
@ -299,7 +299,10 @@ export class MyUtils {
|
||||
console.log("curClientW :", curClientW, "designWidth: ", designWidth, "-> ", nowFrontSize);
|
||||
let testDiv = document.getElementById("testDevice")
|
||||
testDiv.innerText = testDiv.innerText +
|
||||
"\n isMobile :" + /Mobi|Android|iPhone/i.test(navigator.userAgent) +
|
||||
"\n navigator_userAgent :" + navigator.userAgent.toLocaleLowerCase() +
|
||||
"\n isMobile :" + /mobi|android|iphone|ipad|ipod/i.test(navigator.userAgent.toLocaleLowerCase()) +
|
||||
"\n isIOS :" + /iphone|ipad|ipod/.test(window.navigator.userAgent.toLocaleLowerCase()) +
|
||||
"\n isAndroid :" + /android/.test(window.navigator.userAgent.toLocaleLowerCase()) +
|
||||
"\n curClientW :" + curClientW +
|
||||
" \n designWidth: " + designWidth +
|
||||
"\n -> " + nowFrontSize
|
||||
|
@ -20,6 +20,12 @@ import {MyEventListener} from "./event/MyEventListener.js";
|
||||
* ctx
|
||||
*/
|
||||
ctx: {
|
||||
/**
|
||||
* 是否是手机端
|
||||
*/
|
||||
isMobile: /mobi|android|iphone|ipad|ipod/i.test(navigator.userAgent.toLocaleLowerCase()),
|
||||
isIOS: /iphone|ipad|ipod/.test(window.navigator.userAgent.toLocaleLowerCase()),
|
||||
isAndroid: /android/.test(window.navigator.userAgent.toLocaleLowerCase()),
|
||||
|
||||
/**
|
||||
* 默认body front-size 单位px
|
||||
@ -163,5 +169,22 @@ window.onload = function () {
|
||||
console.log("mousedown: ", event)
|
||||
window.myEdit.utils.ProhibitDefaultEvent(event);
|
||||
}, false);
|
||||
|
||||
|
||||
/**
|
||||
* 监听手机键盘
|
||||
*/
|
||||
if (window.myEdit.ctx.isMobile) {
|
||||
if (window.myEdit.ctx.isIOS) {
|
||||
// window.addEventListener("")
|
||||
} else if (window.myEdit.ctx.isAndroid) {
|
||||
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.keyBoardHeight = window.innerHeight - window.visualViewport.height;
|
||||
console.log("mobile: ", this.keyBoardHeight)
|
||||
}, 800);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user