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 {clearOBG} from "./dock/util";
import {recordBeforeResizeTop} from "../protyle/util/resize";
import {stopScrollAnimation} from "../boot/globalEvent/dragover";
export class Wnd {
private app: App;

View file

@ -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");

View file

@ -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", `<div class="b3-label b3-label--noborder">
<div class="fn__flex">

View file

@ -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;

View file

@ -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)