Browse Source

:art: fix https://github.com/siyuan-note/siyuan/issues/10565

Vanessa 1 year ago
parent
commit
9dac9aad56

+ 23 - 0
app/src/assets/scss/protyle/_wysiwyg.scss

@@ -637,4 +637,27 @@
   .img:hover .protyle-icons {
     display: none;
   }
+
+  .av {
+    .b3-chip[data-type="block-more"],
+    .av__row--util,
+    .av__row--header > .block__icons,
+    .av__views .fn__space,
+    .av__views .block__icon:not([data-type="av-search-icon"]),
+    .av__widthdrag {
+      display: none;
+    }
+
+    .av__row--footer {
+      border-top-color: transparent;
+    }
+
+    .av__row > div:nth-last-child(-n + 2) {
+      border-right-color: transparent;
+    }
+
+    .av__row--footer:hover .av__calc:not(.av__calc--ashow) {
+      opacity: 0;
+    }
+  }
 }

+ 13 - 9
app/src/protyle/render/av/action.ts

@@ -49,6 +49,19 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
         return true;
     }
 
+    const searchIconElement = hasClosestByAttribute(event.target, "data-type", "av-search-icon");
+    if (searchIconElement) {
+        const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
+        searchElement.style.width = "128px";
+        searchElement.style.paddingLeft = "";
+        searchElement.style.paddingRight = "";
+        searchElement.focus();
+        event.preventDefault();
+        event.stopPropagation();
+        return true;
+    }
+
+
     if (protyle.disabled) {
         return false;
     }
@@ -115,15 +128,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
             event.preventDefault();
             event.stopPropagation();
             return true;
-        } else if (type === "av-search-icon") {
-            const searchElement = blockElement.querySelector('input[data-type="av-search"]') as HTMLInputElement;
-            searchElement.style.width = "128px";
-            searchElement.style.paddingLeft = "";
-            searchElement.style.paddingRight = "";
-            searchElement.focus();
-            event.preventDefault();
-            event.stopPropagation();
-            return true;
         } else if (type === "av-filter") {
             openMenuPanel({protyle, blockElement, type: "filters"});
             event.preventDefault();

+ 1 - 1
app/src/protyle/render/av/cell.ts

@@ -608,7 +608,7 @@ export const renderCell = (cellValue: IAVCellValue) => {
 <span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.more}</span>`;
         } else {
             text = `<span data-type="block-ref" data-id="${cellValue.block.id}" data-subtype="s" class="av__celltext av__celltext--ref">${cellValue.block.content || "Untitled"}</span>
-<span class="b3-chip b3-chip--info b3-chip--small popover__block" data-id="${cellValue.block.id}" data-type="block-more">${window.siyuan.languages.update}</span>`;
+<span class="b3-chip b3-chip--info b3-chip--small" data-type="block-more">${window.siyuan.languages.update}</span>`;
         }
     } else if (cellValue.type === "number") {
         text = `<span class="av__celltext" data-content="${cellValue?.number.isNotEmpty ? cellValue?.number.content : ""}">${cellValue?.number.formattedContent || cellValue?.number.content || ""}</span>`;