From 6738cfdac9da7b669e4aa546efbe1256be32dd7b Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 28 Dec 2022 15:10:43 +0800 Subject: [PATCH] :bug: fix https://github.com/siyuan-note/siyuan/issues/6930 --- app/src/protyle/util/editorCommonEvent.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index f2bc1ca48..5d09226aa 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -141,11 +141,9 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen topSourceElement = targetElement; } } - if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") { + if (isCopy && item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") { item.removeAttribute("fold"); - if (isCopy) { - foldHeadingIds.push({id, parentID}); - } + foldHeadingIds.push({id, parentID}); } let copyId; let copyElement; @@ -359,11 +357,9 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen if (index === 0) { afterPreviousID = isCopy ? copyId : id; } - if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") { + if (isCopy && item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") { item.removeAttribute("fold"); - if (isCopy) { - foldHeadingIds.push({id, parentID}); - } + foldHeadingIds.push({id, parentID}); } if (isCopy) { undoOperations.push({