mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-06 04:40:15 +01:00
This commit is contained in:
parent
0b85b70f15
commit
52369911b1
2 changed files with 17 additions and 17 deletions
|
|
@ -79,23 +79,6 @@ export const onGetConfig = (isStart: boolean, app: App) => {
|
|||
let resizeTimeout = 0;
|
||||
let firstResize = true;
|
||||
window.addEventListener("resize", () => {
|
||||
/// #if MOBILE
|
||||
// 获取键盘高度
|
||||
window.siyuan.mobile.size.isLandscape = window.matchMedia && window.matchMedia("(orientation: landscape)").matches;
|
||||
if (window.siyuan.mobile.size.isLandscape) {
|
||||
if (window.innerHeight < window.siyuan.mobile.size.landscape.height1) {
|
||||
window.siyuan.mobile.size.landscape.height2 = window.innerHeight;
|
||||
} else {
|
||||
window.siyuan.mobile.size.landscape.height1 = window.innerHeight;
|
||||
}
|
||||
} else {
|
||||
if (window.innerHeight < window.siyuan.mobile.size.portrait.height1) {
|
||||
window.siyuan.mobile.size.portrait.height2 = window.innerHeight;
|
||||
} else {
|
||||
window.siyuan.mobile.size.portrait.height1 = window.innerHeight;
|
||||
}
|
||||
}
|
||||
/// #endif
|
||||
if (firstResize) {
|
||||
recordBeforeResizeTop();
|
||||
firstResize = false;
|
||||
|
|
|
|||
|
|
@ -195,3 +195,20 @@ window.openFileByURL = (openURL) => {
|
|||
}
|
||||
return false;
|
||||
};
|
||||
window.addEventListener("resize", () => {
|
||||
// 获取键盘高度
|
||||
window.siyuan.mobile.size.isLandscape = window.matchMedia && window.matchMedia("(orientation: landscape)").matches;
|
||||
if (window.siyuan.mobile.size.isLandscape) {
|
||||
if (window.innerHeight < window.siyuan.mobile.size.landscape.height1) {
|
||||
window.siyuan.mobile.size.landscape.height2 = window.innerHeight;
|
||||
} else {
|
||||
window.siyuan.mobile.size.landscape.height1 = window.innerHeight;
|
||||
}
|
||||
} else {
|
||||
if (window.innerHeight < window.siyuan.mobile.size.portrait.height1) {
|
||||
window.siyuan.mobile.size.portrait.height2 = window.innerHeight;
|
||||
} else {
|
||||
window.siyuan.mobile.size.portrait.height1 = window.innerHeight;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue