mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 15:28:49 +01:00
This commit is contained in:
parent
029d824834
commit
736fdb2d7e
3 changed files with 9 additions and 5 deletions
|
|
@ -37,10 +37,7 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
|||
window.siyuan.menus.menu.remove();
|
||||
}
|
||||
}
|
||||
// protyle.toolbar 点击空白处时进行隐藏
|
||||
if (!hasClosestByClassName(event.target, "protyle-toolbar")) {
|
||||
hideAllElements(["toolbar"]);
|
||||
}
|
||||
|
||||
if (!hasClosestByClassName(event.target, "pdf__outer")) {
|
||||
hideAllElements(["pdfutil"]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import {Tab} from "../../layout/Tab";
|
|||
import {hideTooltip} from "../../dialog/tooltip";
|
||||
import {openFileById} from "../../editor/util";
|
||||
import {checkFold} from "../../util/noRelyPCFunction";
|
||||
import {hideAllElements} from "../../protyle/ui/hideElements";
|
||||
|
||||
export const initWindowEvent = (app: App) => {
|
||||
document.body.addEventListener("mouseleave", () => {
|
||||
|
|
@ -57,6 +58,13 @@ export const initWindowEvent = (app: App) => {
|
|||
}
|
||||
});
|
||||
|
||||
window.addEventListener("mousedown", (event) => {
|
||||
// protyle.toolbar 点击空白处时进行隐藏
|
||||
if (!hasClosestByClassName(event.target as Element, "protyle-toolbar")) {
|
||||
hideAllElements(["toolbar"]);
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener("keyup", (event) => {
|
||||
windowKeyUp(app, event);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2656,7 +2656,6 @@ export class WYSIWYG {
|
|||
if (newRange.toString().replace(Constants.ZWSP, "") !== "") {
|
||||
protyle.toolbar.render(protyle, newRange);
|
||||
} else {
|
||||
hideElements(["toolbar"], protyle);
|
||||
// https://github.com/siyuan-note/siyuan/issues/9785
|
||||
protyle.toolbar.range = newRange;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue