Vanessa 2024-08-12 10:28:48 +08:00
parent c8f2f9dab6
commit 49d6f297a1
3 changed files with 13 additions and 4 deletions

View file

@ -183,9 +183,6 @@ export class BlockPanel {
},
typewriterMode: false,
after: (editor) => {
editorElement.addEventListener("mouseleave", () => {
hideElements(["gutter"], editor.protyle);
});
if (response.data.rootID !== this.nodeIds[index]) {
editor.protyle.breadcrumb.element.parentElement.lastElementChild.classList.remove("fn__none");
}

View file

@ -35,6 +35,7 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
coordinates.screenX = event.screenX;
coordinates.screenY = event.screenY;
// breadcrumb
if (window.siyuan.hideBreadcrumb) {
window.siyuan.hideBreadcrumb = false;
getAllEditor().forEach(item => {
@ -44,6 +45,8 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
}
});
}
// Dock
if (!mouseIsEnter &&
event.buttons === 0 && // 鼠标按键被按下时不触发
window.siyuan.layout.bottomDock &&
@ -79,6 +82,8 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
window.siyuan.layout.bottomDock.showDock();
}
}
// gutter
const eventPath0 = event.composedPath()[0] as HTMLElement;
if (eventPath0 && eventPath0.nodeType !== 3 && eventPath0.classList.contains("protyle-wysiwyg") && eventPath0.style.paddingLeft) {
// 光标在编辑器右边也需要进行显示
@ -179,6 +184,13 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
return;
}
if (!hasClosestByClassName(event.target, "protyle", true)) {
document.querySelectorAll(".protyle-gutters").forEach(item => {
item.classList.add("fn__none");
item.innerHTML = "";
});
}
const target = event.target as Element;
const blockElement = hasClosestByClassName(target, "table");
if (blockElement && blockElement.style.cursor !== "col-resize" && !hasClosestByClassName(blockElement, "protyle-wysiwyg__embed")) {

View file

@ -4,7 +4,7 @@ import {getCurrentEditor} from "../../mobile/editor";
import {getAllEditor} from "../../layout/getAll";
/// #endif
// "gutter", "toolbar", "select", "hint", "util", "dialog"
// "gutter", "toolbar", "select", "hint", "util", "dialog", "gutterOnly"
export const hideElements = (panels: string[], protyle?: IProtyle, focusHide = false) => {
if (!protyle) {
if (panels.includes("dialog")) {