mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🚨
This commit is contained in:
parent
292cd32a0b
commit
860924656d
3 changed files with 6 additions and 7 deletions
|
|
@ -105,7 +105,7 @@ class App {
|
||||||
if (unPinMenu) {
|
if (unPinMenu) {
|
||||||
unPinMenu.forEach(unpinItem => {
|
unPinMenu.forEach(unpinItem => {
|
||||||
unPinsMenu.push(unpinItem);
|
unPinsMenu.push(unpinItem);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (unPinsMenu.length > 0) {
|
if (unPinsMenu.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import {exportLayout, resizeTopBar} from "../layout/util";
|
||||||
import {API} from "./API";
|
import {API} from "./API";
|
||||||
import {getFrontend, isMobile, isWindow} from "../util/functions";
|
import {getFrontend, isMobile, isWindow} from "../util/functions";
|
||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
import {Menu} from "./Menu";
|
|
||||||
|
|
||||||
const getObject = (key: string) => {
|
const getObject = (key: string) => {
|
||||||
const api = {
|
const api = {
|
||||||
|
|
|
||||||
|
|
@ -1060,11 +1060,11 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
if (event.clientY > editorElement.lastElementChild.getBoundingClientRect().bottom) {
|
if (event.clientY > editorElement.lastElementChild.getBoundingClientRect().bottom) {
|
||||||
// 命中底部
|
// 命中底部
|
||||||
targetElement = editorElement.lastElementChild as HTMLElement;
|
targetElement = editorElement.lastElementChild as HTMLElement;
|
||||||
point.className = "dragover__bottom"
|
point.className = "dragover__bottom";
|
||||||
} else if (event.clientY < editorElement.firstElementChild.getBoundingClientRect().top) {
|
} else if (event.clientY < editorElement.firstElementChild.getBoundingClientRect().top) {
|
||||||
// 命中顶部
|
// 命中顶部
|
||||||
targetElement = editorElement.firstElementChild as HTMLElement
|
targetElement = editorElement.firstElementChild as HTMLElement;
|
||||||
point.className = "dragover__top"
|
point.className = "dragover__top";
|
||||||
} else {
|
} else {
|
||||||
if (event.clientX < editorPosition.left) {
|
if (event.clientX < editorPosition.left) {
|
||||||
// 左侧
|
// 左侧
|
||||||
|
|
@ -1105,7 +1105,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (point.className) {
|
if (point.className) {
|
||||||
targetElement.classList.add(point.className)
|
targetElement.classList.add(point.className);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (targetElement.getAttribute("data-type") === "NodeListItem" || fileTreeIds.indexOf("-") > -1) {
|
if (targetElement.getAttribute("data-type") === "NodeListItem" || fileTreeIds.indexOf("-") > -1) {
|
||||||
|
|
@ -1197,7 +1197,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
dragoverElement = targetElement;
|
dragoverElement = targetElement;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
editorElement.addEventListener("dragleave", (event: DragEvent & { target: HTMLElement }) => {
|
editorElement.addEventListener("dragleave", () => {
|
||||||
editorElement.querySelectorAll(".dragover__left, .dragover__right, .dragover__bottom, .dragover__top").forEach((item: HTMLElement) => {
|
editorElement.querySelectorAll(".dragover__left, .dragover__right, .dragover__bottom, .dragover__top").forEach((item: HTMLElement) => {
|
||||||
item.classList.remove("dragover__top", "dragover__bottom", "dragover__left", "dragover__right");
|
item.classList.remove("dragover__top", "dragover__bottom", "dragover__left", "dragover__right");
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue