Forráskód Böngészése

:lipstick: fix https://github.com/siyuan-note/siyuan/issues/10727

Vanessa 1 éve
szülő
commit
ffd6459540
2 módosított fájl, 3 hozzáadás és 9 törlés
  1. 1 8
      app/src/constants.ts
  2. 2 1
      app/src/protyle/util/editorCommonEvent.ts

+ 1 - 8
app/src/constants.ts

@@ -482,14 +482,7 @@ export abstract class Constants {
                     "size": "auto",
                     "type": "center",
                     "instance": "Layout",
-                    "children": [{
-                        "instance": "Wnd",
-                        "children": [],
-                        // "children": [{
-                        //     "instance": "Tab",
-                        //     "children": []
-                        // }]
-                    }]
+                    "children": [{"instance": "Wnd", "children": [{"instance": "Tab", "children": []}]}]
                 }, {
                     "direction": "tb",
                     "size": "0px",

+ 2 - 1
app/src/protyle/util/editorCommonEvent.ts

@@ -1056,9 +1056,10 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
     let dragoverElement: Element;
     let disabledPosition: string;
     editorElement.addEventListener("dragover", (event: DragEvent & { target: HTMLElement }) => {
-        if (protyle.disabled) {
+        if (protyle.disabled || event.dataTransfer.types.includes(Constants.SIYUAN_DROP_EDITOR)) {
             event.preventDefault();
             event.stopPropagation();
+            event.dataTransfer.dropEffect = "none";
             return;
         }
         const contentRect = protyle.contentElement.getBoundingClientRect();