diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.ts index 977dfd656..5c37ef705 100644 --- a/app/src/layout/Wnd.ts +++ b/app/src/layout/Wnd.ts @@ -52,7 +52,6 @@ import {setPadding} from "../protyle/ui/initUI"; import {setPosition} from "../util/setPosition"; import {clearOBG} from "./dock/util"; import {recordBeforeResizeTop} from "../protyle/util/resize"; -import {stopScrollAnimation} from "../boot/globalEvent/dragover"; export class Wnd { private app: App; diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts index a03c0e782..2c02ed29d 100644 --- a/app/src/layout/dock/Files.ts +++ b/app/src/layout/dock/Files.ts @@ -28,7 +28,6 @@ import {ipcRenderer} from "electron"; /// #endif import {hideTooltip, showTooltip} from "../../dialog/tooltip"; import {selectOpenTab} from "./util"; -import {dragOverScroll, stopScrollAnimation} from "../../boot/globalEvent/dragover"; export class Files extends Model { public element: HTMLElement; @@ -490,7 +489,6 @@ export class Files extends Model { if (window.siyuan.config.readonly || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) { return; } - // dragOverScroll(event, this.element.getBoundingClientRect(), this.element); let liElement = hasClosestByTag(event.target, "LI"); if (!liElement) { liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI"); diff --git a/app/src/menus/commonMenuItem.ts b/app/src/menus/commonMenuItem.ts index 7817345d3..81a0226dc 100644 --- a/app/src/menus/commonMenuItem.ts +++ b/app/src/menus/commonMenuItem.ts @@ -365,7 +365,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I } }); if (existElement) { - showMessage(window.siyuan.languages.hasAttrName.replace('${x}', value)); + showMessage(window.siyuan.languages.hasAttrName.replace("${x}", value)); } else { target.parentElement.insertAdjacentHTML("beforebegin", `
diff --git a/app/src/protyle/gutter/index.ts b/app/src/protyle/gutter/index.ts index dd004ee6d..d0a79a37e 100644 --- a/app/src/protyle/gutter/index.ts +++ b/app/src/protyle/gutter/index.ts @@ -63,7 +63,6 @@ import * as path from "path"; /// #endif import {checkFold} from "../../util/noRelyPCFunction"; import {clearSelect} from "../util/clear"; -import {stopScrollAnimation} from "../../boot/globalEvent/dragover"; export class Gutter { public element: HTMLElement; diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 78c79cb14..729c625fe 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -36,7 +36,6 @@ import {processClonePHElement} from "../render/util"; import {insertGalleryItemAnimation} from "../render/av/gallery/item"; import {clearSelect} from "./clear"; import {dragoverTab} from "../render/av/view"; -import {dragOverScroll, stopScrollAnimation} from "../../boot/globalEvent/dragover"; // position: afterbegin 为拖拽成超级块; "afterend", "beforebegin" 一般拖拽 const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElement: Element, @@ -1196,10 +1195,6 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { event.preventDefault(); return; } - const contentRect = protyle.contentElement.getBoundingClientRect(); - if (!hasClosestByClassName(event.target, "av__cell")) { - dragOverScroll(event, contentRect, protyle.contentElement); - } let targetElement: HTMLElement | false; // 设置了的话 drop 就无法监听 shift/control event.dataTransfer.dropEffect = "move"; if (event.dataTransfer.types.includes("Files")) { @@ -1279,7 +1274,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { // 命中顶部 targetElement = editorElement.firstElementChild as HTMLElement; point.className = "dragover__top"; - } else if (contentRect) { + } else { + const contentRect = protyle.contentElement.getBoundingClientRect(); const editorPosition = { left: contentRect.left + parseInt(editorElement.style.paddingLeft), right: contentRect.left + protyle.contentElement.clientWidth - parseInt(editorElement.style.paddingRight)