소스 검색

:bug: fix https://github.com/siyuan-note/siyuan/issues/6930

Vanessa 2 년 전
부모
커밋
6738cfdac9
1개의 변경된 파일4개의 추가작업 그리고 8개의 파일을 삭제
  1. 4 8
      app/src/protyle/util/editorCommonEvent.ts

+ 4 - 8
app/src/protyle/util/editorCommonEvent.ts

@@ -141,11 +141,9 @@ const moveTo = async (protyle: IProtyle, sourceElements: Element[], targetElemen
                 topSourceElement = targetElement;
                 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");
             item.removeAttribute("fold");
-            if (isCopy) {
-                foldHeadingIds.push({id, parentID});
-            }
+            foldHeadingIds.push({id, parentID});
         }
         }
         let copyId;
         let copyId;
         let copyElement;
         let copyElement;
@@ -359,11 +357,9 @@ const dragSb = async (protyle: IProtyle, sourceElements: Element[], targetElemen
             if (index === 0) {
             if (index === 0) {
                 afterPreviousID = isCopy ? copyId : id;
                 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");
                 item.removeAttribute("fold");
-                if (isCopy) {
-                    foldHeadingIds.push({id, parentID});
-                }
+                foldHeadingIds.push({id, parentID});
             }
             }
             if (isCopy) {
             if (isCopy) {
                 undoOperations.push({
                 undoOperations.push({