to:sync
This commit is contained in:
parent
e262655dec
commit
6a375cacbc
@ -287,7 +287,7 @@ export class MyUtils {
|
||||
*/
|
||||
RefreshRootFrontSize() {
|
||||
let curDoc = document.documentElement;//当前文档的 root 元素
|
||||
let curClientW = document.documentElement.clientWidth || document.body.clientWidth;
|
||||
let curClientW = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
if (!curClientW) {
|
||||
return
|
||||
}
|
||||
@ -304,6 +304,7 @@ export class MyUtils {
|
||||
"\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 window.width :" + window.innerWidth +
|
||||
"\n curClientW :" + curClientW +
|
||||
" \n designWidth: " + designWidth +
|
||||
"\n 1rem = " + nowFrontSize;
|
||||
|
@ -8,7 +8,7 @@ import {MyEventListener} from "./event/MyEventListener.js";
|
||||
const userAgent = window.navigator.userAgent;
|
||||
// 获取屏幕宽度
|
||||
// const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
const screenWidth = document.documentElement.clientWidth || document.body.clientWidth;
|
||||
const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
// 判断是否是手机
|
||||
const isMobile = /mobi|android|iphone|ipad|ipod/i.test(userAgent.toLocaleLowerCase()) || screenWidth < 768;
|
||||
const isIOS = /iphone|ipad|ipod/i.test(userAgent.toLocaleLowerCase()) || screenWidth < 768;
|
||||
@ -39,9 +39,9 @@ import {MyEventListener} from "./event/MyEventListener.js";
|
||||
isAndroid: isAndroid,
|
||||
//判断是否是平板电脑
|
||||
isTablet: isTablet,
|
||||
screenWidth: document.documentElement.clientWidth || document.body.clientWidth,
|
||||
screenWidth: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
|
||||
//高度 for android
|
||||
screenHeight: document.documentElement.clientHeight || document.body.clientHeight,
|
||||
screenHeight: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
|
||||
/**
|
||||
* 默认body front-size 单位px
|
||||
*/
|
||||
@ -161,7 +161,7 @@ window.onload = function () {
|
||||
newParagraph.setAttribute("id", uuid)
|
||||
newParagraph.setAttribute("data-order", curOrder)
|
||||
newParagraph.onkeyup = window.myEdit.eventListener.KeydownListener
|
||||
// newParagraph.innerHTML = "<br>"
|
||||
newParagraph.innerHTML = "<br>"
|
||||
//添加一行
|
||||
window.myEdit.utils.AddNewParagraph(newParagraph);
|
||||
|
||||
|
@ -125,7 +125,7 @@
|
||||
测试编辑
|
||||
</h3>
|
||||
<!-- 内容 -->
|
||||
<div id="noteshare" spellcheck="false" translate="no">
|
||||
<div id="noteshare" contenteditable="true" spellcheck="false" translate="no">
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user