Vanessa 2024-11-22 00:21:02 +08:00
parent 2d114d4c3b
commit 0049c49158
7 changed files with 45 additions and 21 deletions

View file

@ -29,6 +29,7 @@ import {sendGlobalShortcut} from "./globalEvent/keydown";
import {closeWindow} from "../window/closeWin";
import {checkFold} from "../util/noRelyPCFunction";
import {correctHotkey} from "./globalEvent/commonHotkey";
import {recordBeforeResizeTop} from "../protyle/util/resize";
export const onGetConfig = (isStart: boolean, app: App) => {
correctHotkey(app);
@ -67,12 +68,18 @@ export const onGetConfig = (isStart: boolean, app: App) => {
setInlineStyle();
renderSnippet();
let resizeTimeout = 0;
let firstResize = true;
window.addEventListener("resize", () => {
if (firstResize) {
recordBeforeResizeTop();
firstResize = false;
}
window.clearTimeout(resizeTimeout);
resizeTimeout = window.setTimeout(() => {
adjustLayout();
resizeTabs();
resizeTopBar();
firstResize = true;
}, 200);
});
addGA();