Vanessa 2025-11-30 20:24:18 +08:00
parent 5236f692a8
commit 4de05be87d
5 changed files with 3 additions and 11 deletions

View file

@ -52,7 +52,6 @@ import {setPadding} from "../protyle/ui/initUI";
import {setPosition} from "../util/setPosition"; import {setPosition} from "../util/setPosition";
import {clearOBG} from "./dock/util"; import {clearOBG} from "./dock/util";
import {recordBeforeResizeTop} from "../protyle/util/resize"; import {recordBeforeResizeTop} from "../protyle/util/resize";
import {stopScrollAnimation} from "../boot/globalEvent/dragover";
export class Wnd { export class Wnd {
private app: App; private app: App;

View file

@ -28,7 +28,6 @@ import {ipcRenderer} from "electron";
/// #endif /// #endif
import {hideTooltip, showTooltip} from "../../dialog/tooltip"; import {hideTooltip, showTooltip} from "../../dialog/tooltip";
import {selectOpenTab} from "./util"; import {selectOpenTab} from "./util";
import {dragOverScroll, stopScrollAnimation} from "../../boot/globalEvent/dragover";
export class Files extends Model { export class Files extends Model {
public element: HTMLElement; 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)) { if (window.siyuan.config.readonly || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_TAB)) {
return; return;
} }
// dragOverScroll(event, this.element.getBoundingClientRect(), this.element);
let liElement = hasClosestByTag(event.target, "LI"); let liElement = hasClosestByTag(event.target, "LI");
if (!liElement) { if (!liElement) {
liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI"); liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI");

View file

@ -365,7 +365,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
} }
}); });
if (existElement) { if (existElement) {
showMessage(window.siyuan.languages.hasAttrName.replace('${x}', value)); showMessage(window.siyuan.languages.hasAttrName.replace("${x}", value));
} else { } else {
target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder"> target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder">
<div class="fn__flex"> <div class="fn__flex">

View file

@ -63,7 +63,6 @@ import * as path from "path";
/// #endif /// #endif
import {checkFold} from "../../util/noRelyPCFunction"; import {checkFold} from "../../util/noRelyPCFunction";
import {clearSelect} from "../util/clear"; import {clearSelect} from "../util/clear";
import {stopScrollAnimation} from "../../boot/globalEvent/dragover";
export class Gutter { export class Gutter {
public element: HTMLElement; public element: HTMLElement;

View file

@ -36,7 +36,6 @@ import {processClonePHElement} from "../render/util";
import {insertGalleryItemAnimation} from "../render/av/gallery/item"; import {insertGalleryItemAnimation} from "../render/av/gallery/item";
import {clearSelect} from "./clear"; import {clearSelect} from "./clear";
import {dragoverTab} from "../render/av/view"; import {dragoverTab} from "../render/av/view";
import {dragOverScroll, stopScrollAnimation} from "../../boot/globalEvent/dragover";
// position: afterbegin 为拖拽成超级块; "afterend", "beforebegin" 一般拖拽 // position: afterbegin 为拖拽成超级块; "afterend", "beforebegin" 一般拖拽
const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElement: Element, const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElement: Element,
@ -1196,10 +1195,6 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
event.preventDefault(); event.preventDefault();
return; return;
} }
const contentRect = protyle.contentElement.getBoundingClientRect();
if (!hasClosestByClassName(event.target, "av__cell")) {
dragOverScroll(event, contentRect, protyle.contentElement);
}
let targetElement: HTMLElement | false; let targetElement: HTMLElement | false;
// 设置了的话 drop 就无法监听 shift/control event.dataTransfer.dropEffect = "move"; // 设置了的话 drop 就无法监听 shift/control event.dataTransfer.dropEffect = "move";
if (event.dataTransfer.types.includes("Files")) { if (event.dataTransfer.types.includes("Files")) {
@ -1279,7 +1274,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
// 命中顶部 // 命中顶部
targetElement = editorElement.firstElementChild as HTMLElement; targetElement = editorElement.firstElementChild as HTMLElement;
point.className = "dragover__top"; point.className = "dragover__top";
} else if (contentRect) { } else {
const contentRect = protyle.contentElement.getBoundingClientRect();
const editorPosition = { const editorPosition = {
left: contentRect.left + parseInt(editorElement.style.paddingLeft), left: contentRect.left + parseInt(editorElement.style.paddingLeft),
right: contentRect.left + protyle.contentElement.clientWidth - parseInt(editorElement.style.paddingRight) right: contentRect.left + protyle.contentElement.clientWidth - parseInt(editorElement.style.paddingRight)