Vanessa 2025-12-18 12:25:00 +08:00
parent ed44e92bbd
commit 35874e5075
3 changed files with 21 additions and 2 deletions

View file

@ -13,6 +13,7 @@ import {App} from "../index";
import {afterLoadPlugin} from "../plugin/loader";
import {Tab} from "../layout/Tab";
import {initWindowEvent} from "../boot/globalEvent/event";
import {getAllEditor} from "../layout/getAll";
export const init = (app: App) => {
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
@ -61,7 +62,15 @@ export const init = (app: App) => {
resizeTimeout = window.setTimeout(() => {
adjustLayout(window.siyuan.layout.centerLayout);
resizeTabs();
}, 200);
if (getSelection().rangeCount > 0) {
const range = getSelection().getRangeAt(0);
getAllEditor().forEach(item => {
if (item.protyle.wysiwyg.element.contains(range.startContainer)) {
item.protyle.toolbar.render(item.protyle, range);
}
});
}
}, Constants.TIMEOUT_RESIZE);
});
};