mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
This commit is contained in:
parent
0aa9c82450
commit
22186cdb9d
1 changed files with 5 additions and 9 deletions
|
|
@ -229,7 +229,7 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newListId && (index === 0||
|
if (newListId && (index === 0 ||
|
||||||
sourceElements[index - 1].getAttribute("data-type") !== "NodeListItem" ||
|
sourceElements[index - 1].getAttribute("data-type") !== "NodeListItem" ||
|
||||||
sourceElements[index - 1].getAttribute("data-subtype") !== item.getAttribute("data-subtype"))
|
sourceElements[index - 1].getAttribute("data-subtype") !== item.getAttribute("data-subtype"))
|
||||||
) {
|
) {
|
||||||
|
|
@ -816,9 +816,9 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
const blockElement = hasClosestBlock(targetElement);
|
const blockElement = hasClosestBlock(targetElement);
|
||||||
if (blockElement) {
|
if (blockElement) {
|
||||||
let previousID = "";
|
let previousID = "";
|
||||||
if (targetClass.includes("dragover__right")) {
|
if (targetClass.includes("dragover__right") || targetElement.classList.contains("dragover__bottom")) {
|
||||||
previousID = targetElement.getAttribute("data-id") || "";
|
previousID = targetElement.getAttribute("data-id") || "";
|
||||||
} else {
|
} else if (targetElement.classList.contains("dragover__top") || targetElement.classList.contains("dragover__left")) {
|
||||||
previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";
|
previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";
|
||||||
}
|
}
|
||||||
const avID = blockElement.getAttribute("data-av-id");
|
const avID = blockElement.getAttribute("data-av-id");
|
||||||
|
|
@ -957,14 +957,10 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
const blockElement = hasClosestBlock(targetElement);
|
const blockElement = hasClosestBlock(targetElement);
|
||||||
if (blockElement) {
|
if (blockElement) {
|
||||||
let previousID = "";
|
let previousID = "";
|
||||||
if (targetElement.classList.contains("dragover__bottom")) {
|
if (targetElement.classList.contains("dragover__bottom") || targetElement.classList.contains("dragover__right")) {
|
||||||
previousID = targetElement.getAttribute("data-id") || "";
|
previousID = targetElement.getAttribute("data-id") || "";
|
||||||
} else if (targetElement.classList.contains("dragover__top")) {
|
} else if (targetElement.classList.contains("dragover__top") || targetElement.classList.contains("dragover__left")) {
|
||||||
previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";
|
previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";
|
||||||
} else if (targetElement.classList.contains("dragover__left")) {
|
|
||||||
previousID = targetElement.previousElementSibling?.getAttribute("data-id") || "";
|
|
||||||
} else if (targetElement.classList.contains("dragover__right")) {
|
|
||||||
previousID = targetElement.getAttribute("data-id") || "";
|
|
||||||
}
|
}
|
||||||
const avID = blockElement.getAttribute("data-av-id");
|
const avID = blockElement.getAttribute("data-av-id");
|
||||||
const newUpdated = dayjs().format("YYYYMMDDHHmmss");
|
const newUpdated = dayjs().format("YYYYMMDDHHmmss");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue