Vanessa 2024-10-19 23:01:09 +08:00
parent 3ff902e547
commit d173f26d35

View File

@ -573,13 +573,23 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen
// 跨文档不支持撤销 // 跨文档不支持撤销
transaction(protyle, doOperations); transaction(protyle, doOperations);
} }
if (direct === "col" && (sourceElements.length > 1 || hasFoldHeading) && !isCopy) { if (!isCopy && direct === "col") {
turnsIntoOneTransaction({ if (targetElement.getAttribute("data-type") === "NodeHeading" && targetElement.getAttribute("fold") === "1") {
protyle, turnsIntoOneTransaction({
selectsElement: sourceElements.reverse(), protyle,
type: "BlocksMergeSuperBlock", selectsElement: [targetElement],
level: "row" type: "BlocksMergeSuperBlock",
}); level: "row"
});
}
if ((sourceElements.length > 1 || hasFoldHeading)) {
turnsIntoOneTransaction({
protyle,
selectsElement: sourceElements.reverse(),
type: "BlocksMergeSuperBlock",
level: "row"
});
}
} }
focusBlock(sourceElements[0]); focusBlock(sourceElements[0]);
}; };