Vanessa 2025-05-26 21:34:22 +08:00
parent 656f094c44
commit 761a32c8df
2 changed files with 16 additions and 2 deletions

View file

@ -19,7 +19,7 @@ import {hasClosestByClassName} from "../../protyle/util/hasClosest";
import {App} from "../../index";
import {Plugin} from "../../plugin";
import {Custom} from "./Custom";
import {recordBeforeResizeTop} from "../../protyle/util/resize";
import {clearBeforeResizeTop, recordBeforeResizeTop} from "../../protyle/util/resize";
import {Constants} from "../../constants";
const TYPES = ["file", "outline", "inbox", "bookmark", "tag", "graph", "globalGraph", "backlink"];
@ -497,7 +497,9 @@ export class Dock {
if (!type) {
return;
}
recordBeforeResizeTop();
if (this.pin) {
recordBeforeResizeTop();
}
const target = this.element.querySelector(`[data-type="${type}"]`) as HTMLElement;
if (show && target.classList.contains("dock__item--active")) {
target.classList.remove("dock__item--active", "dock__item--activefocus");
@ -520,6 +522,7 @@ export class Dock {
if (document.activeElement) {
(document.activeElement as HTMLElement).blur();
}
clearBeforeResizeTop();
this.showDock();
return;
}

View file

@ -8,6 +8,17 @@ import {getAllModels} from "../../layout/getAll";
/// #endif
import {stickyRow} from "../render/av/row";
export const clearBeforeResizeTop = () => {
/// #if !MOBILE
getAllModels().editor.forEach((item) => {
if (item.editor && item.editor.protyle &&
item.element.parentElement && !item.element.classList.contains("fn__none")) {
item.editor.protyle.wysiwyg.element.querySelector("[data-resize-top]")?.removeAttribute("data-resize-top");
}
});
/// #endif
}
export const recordBeforeResizeTop = () => {
/// #if !MOBILE
getAllModels().editor.forEach((item) => {