Ver código fonte

:recycle: https://github.com/siyuan-note/siyuan/issues/7123

Vanessa 2 anos atrás
pai
commit
01a3a14ef6
2 arquivos alterados com 11 adições e 3 exclusões
  1. 10 2
      app/src/menus/navigation.ts
  2. 1 1
      app/src/mobile/util/MobileFiles.ts

+ 10 - 2
app/src/menus/navigation.ts

@@ -388,11 +388,19 @@ const genImportMenu = (notebookId: string, pathString: string) => {
                         formData.append("notebook", notebookId);
                         formData.append("notebook", notebookId);
                         formData.append("toPath", pathString);
                         formData.append("toPath", pathString);
                         fetchPost("/api/import/importSY", formData, () => {
                         fetchPost("/api/import/importSY", formData, () => {
+                            let files
                             /// #if MOBILE
                             /// #if MOBILE
-                            window.siyuan.mobile.files.selectItem(notebookId, pathString);
+                            files = window.siyuan.mobile.files
                             /// #else
                             /// #else
-                            (getDockByType("file").data["file"] as Files).selectItem(notebookId, pathString)
+                            files = (getDockByType("file").data["file"] as Files);
                             /// #endif
                             /// #endif
+                            const liElement = files.element.querySelector(`[data-path="${pathString}"]`)
+                            const toggleElement = liElement.querySelector(".b3-list-item__arrow--open");
+                            if (toggleElement) {
+                                toggleElement.classList.remove("b3-list-item__arrow--open");
+                                liElement.nextElementSibling?.remove();
+                            }
+                            files.getLeaf(liElement, notebookId);
                             window.siyuan.menus.menu.remove();
                             window.siyuan.menus.menu.remove();
                         });
                         });
                     });
                     });

+ 1 - 1
app/src/mobile/util/MobileFiles.ts

@@ -649,7 +649,7 @@ export class MobileFiles extends Model {
         }
         }
     }
     }
 
 
-    private getLeaf(liElement: Element, notebookId: string) {
+    public getLeaf(liElement: Element, notebookId: string) {
         const toggleElement = liElement.querySelector(".b3-list-item__arrow");
         const toggleElement = liElement.querySelector(".b3-list-item__arrow");
         if (toggleElement.classList.contains("b3-list-item__arrow--open")) {
         if (toggleElement.classList.contains("b3-list-item__arrow--open")) {
             toggleElement.classList.remove("b3-list-item__arrow--open");
             toggleElement.classList.remove("b3-list-item__arrow--open");