Pārlūkot izejas kodu

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

Vanessa 2 gadi atpakaļ
vecāks
revīzija
cd973ef05b

+ 2 - 1
app/src/assets/scss/_search.scss

@@ -52,7 +52,8 @@
       padding-right: 0;
       border-radius: 2px;
 
-      &:focus {
+      &:focus,
+      &.search__input--block {
         width: 100%;
         border-color: var(--b3-theme-primary);
       }

+ 8 - 0
app/src/layout/dock/Backlinks.ts

@@ -129,6 +129,14 @@ export class Backlinks extends Model {
                     this.searchBacklinks();
                 }
             });
+            item.addEventListener("input", (event: KeyboardEvent) => {
+                const inputElement = event.target as HTMLInputElement
+                if (inputElement.value === "") {
+                    inputElement.classList.remove("search__input--block")
+                } else {
+                    inputElement.classList.add("search__input--block")
+                }
+            });
         });
 
         this.tree = new Tree({

+ 5 - 0
app/src/layout/dock/Graph.ts

@@ -343,6 +343,11 @@ export class Graph extends Model {
             if (event.isComposing) {
                 return;
             }
+            if (this.inputElement.value === "") {
+                this.inputElement.classList.remove("search__input--block")
+            } else {
+                this.inputElement.classList.add("search__input--block")
+            }
             this.searchGraph(false);
         });
         this.element.querySelectorAll(".b3-slider").forEach((item: HTMLInputElement) => {

+ 0 - 1
app/src/menus/tab.ts

@@ -3,7 +3,6 @@ import {MenuItem} from "./Menu";
 import {Editor} from "../editor";
 import {copyTab} from "../layout/util";
 import {copySubMenu} from "./commonMenuItem";
-import {Model} from "../layout/Model";
 
 const closeMenu = (tab: Tab) => {
     const allTabs: Tab[] = [];

+ 1 - 1
app/src/protyle/wysiwyg/index.ts

@@ -322,7 +322,7 @@ export class WYSIWYG {
                 }
                 // 选中整个标题 https://github.com/siyuan-note/siyuan/issues/4329
                 const headElement = hasClosestByAttribute(startContainer, "data-type", "NodeHeading");
-                let isFoldHeading = false
+                let isFoldHeading = false;
                 if (headElement && range.toString() === headElement.firstElementChild.textContent) {
                     const doOperations: IOperation[] = [{
                         action: "delete",

+ 3 - 3
app/src/search/spread.ts

@@ -635,12 +635,12 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: stri
 };
 
 const getKey = (element: HTMLElement) => {
-    const keys: string[] = []
+    const keys: string[] = [];
     element.querySelectorAll("mark").forEach(item => {
         keys.push(item.textContent);
-    })
+    });
     return [...new Set(keys)].join(" ");
-}
+};
 
 const getArticle = (options: {
     id: string,