Bladeren bron

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

Vanessa 2 jaren geleden
bovenliggende
commit
694d7bba9a
3 gewijzigde bestanden met toevoegingen van 13 en 11 verwijderingen
  1. 2 0
      app/src/protyle/gutter/index.ts
  2. 9 9
      app/src/protyle/toolbar/index.ts
  3. 2 2
      app/src/util/pathName.ts

+ 2 - 0
app/src/protyle/gutter/index.ts

@@ -37,6 +37,7 @@ import {transferBlockRef} from "../../menus/block";
 import {isMobile} from "../../util/functions";
 import {AIActions} from "../../ai/actions";
 import {activeBlur} from "../../mobile/util/keyboardToolbar";
+import {hideTooltip} from "../../dialog/tooltip";
 
 export class Gutter {
     public element: HTMLElement;
@@ -52,6 +53,7 @@ export class Gutter {
         this.element.setAttribute("data-type", "a");
         this.element.setAttribute("data-position", "right");
         this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
+            hideTooltip();
             let selectIds: string[] = [event.target.getAttribute("data-node-id")];
             const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
             if (selectElements.length > 0) {

+ 9 - 9
app/src/protyle/toolbar/index.ts

@@ -1495,11 +1495,6 @@ export class Toolbar {
         });
         this.subElement.classList.remove("fn__none");
         this.subElementCloseCB = undefined;
-        /// #if !MOBILE
-        const rangePosition = getSelectionPosition(nodeElement, range);
-        setPosition(this.subElement, rangePosition.left, rangePosition.top + 18, Constants.SIZE_TOOLBAR_HEIGHT);
-        (this.subElement.firstElementChild as HTMLElement).style.maxHeight = Math.min(window.innerHeight * 0.8, window.innerHeight - this.subElement.getBoundingClientRect().top) - 16 + "px";
-        /// #endif
         this.element.classList.add("fn__none");
         inputElement.select();
         fetchPost("/api/search/searchTemplate", {
@@ -1522,6 +1517,11 @@ export class Toolbar {
                 html = `<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`;
             }
             this.subElement.querySelector(".b3-list--background").innerHTML = html;
+            /// #if !MOBILE
+            const rangePosition = getSelectionPosition(nodeElement, range);
+            setPosition(this.subElement, rangePosition.left, rangePosition.top + 18, Constants.SIZE_TOOLBAR_HEIGHT);
+            (this.subElement.firstElementChild as HTMLElement).style.maxHeight = Math.min(window.innerHeight * 0.8, window.innerHeight - this.subElement.getBoundingClientRect().top) - 16 + "px";
+            /// #endif
         });
     }
 
@@ -1573,10 +1573,6 @@ export class Toolbar {
         });
         this.subElement.classList.remove("fn__none");
         this.subElementCloseCB = undefined;
-        /// #if !MOBILE
-        const rangePosition = getSelectionPosition(nodeElement, range);
-        setPosition(this.subElement, rangePosition.left, rangePosition.top + 18, Constants.SIZE_TOOLBAR_HEIGHT);
-        /// #endif
         this.element.classList.add("fn__none");
         inputElement.select();
         fetchPost("/api/search/searchWidget", {
@@ -1587,6 +1583,10 @@ export class Toolbar {
                 html += `<div class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}">${item.content}</div>`;
             });
             this.subElement.querySelector(".b3-list--background").innerHTML = html;
+            /// #if !MOBILE
+            const rangePosition = getSelectionPosition(nodeElement, range);
+            setPosition(this.subElement, rangePosition.left, rangePosition.top + 18, Constants.SIZE_TOOLBAR_HEIGHT);
+            /// #endif
         });
     }
 

+ 2 - 2
app/src/util/pathName.ts

@@ -162,8 +162,8 @@ export const movePathTo = (cb: (toPath: string[], toNotebook: string[]) => void,
             }
         }
     });
-    // 文档树上引用数悬浮层不被遮挡
-    dialog.element.style.zIndex = "200";
+    // 文档树上引用数悬浮层不被遮挡,搜索指定路径不被搜索遮挡
+    dialog.element.style.zIndex = "203";
     if (paths && paths.length > 0) {
         fetchPost("/api/filetree/getHPathsByPaths", {paths}, (response) => {
             dialog.element.querySelector(".b3-dialog__header .ft__smaller").innerHTML = escapeHtml(response.data.join(" "));