MCPcopy Create free account
hub / github.com/CatMuse/HiNote / createSearchInput

Method createSearchInput

src/views/managers/UIInitializer.ts:121–140  ·  view source on GitHub ↗

* 创建搜索输入框

(parent: HTMLElement)

Source from the content-addressed store, hash-verified

119 * 创建搜索输入框
120 */
121 private createSearchInput(parent: HTMLElement): HTMLInputElement {
122 const searchInput = parent.createEl("input", {
123 cls: "highlight-search-input",
124 attr: {
125 type: "text",
126 placeholder: t("Search..."),
127 }
128 });
129
130 // 添加焦点和失焦事件
131 searchInput.addEventListener('focus', () => {
132 parent.addClass('focused');
133 });
134
135 searchInput.addEventListener('blur', () => {
136 parent.removeClass('focused');
137 });
138
139 return searchInput;
140 }
141
142 /**
143 * 创建搜索加载指示器

Callers 1

initializeUIMethod · 0.95

Calls 1

tFunction · 0.90

Tested by

no test coverage detected