mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
This commit is contained in:
parent
656f094c44
commit
761a32c8df
2 changed files with 16 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue