From d173f26d3529fd02873c97341193ed8be4c337d9 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 19 Oct 2024 23:01:09 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12809 --- app/src/protyle/util/editorCommonEvent.ts | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 555c4325c..9dbf18c29 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -573,13 +573,23 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen // 跨文档不支持撤销 transaction(protyle, doOperations); } - if (direct === "col" && (sourceElements.length > 1 || hasFoldHeading) && !isCopy) { - turnsIntoOneTransaction({ - protyle, - selectsElement: sourceElements.reverse(), - type: "BlocksMergeSuperBlock", - level: "row" - }); + if (!isCopy && direct === "col") { + if (targetElement.getAttribute("data-type") === "NodeHeading" && targetElement.getAttribute("fold") === "1") { + turnsIntoOneTransaction({ + protyle, + selectsElement: [targetElement], + type: "BlocksMergeSuperBlock", + level: "row" + }); + } + if ((sourceElements.length > 1 || hasFoldHeading)) { + turnsIntoOneTransaction({ + protyle, + selectsElement: sourceElements.reverse(), + type: "BlocksMergeSuperBlock", + level: "row" + }); + } } focusBlock(sourceElements[0]); };