Skip to content

Commit ed40288

Browse files
committed
search results can now be clicked
1 parent aa817e2 commit ed40288

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

src/getpathoptions.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ export async function getpathlist(path:string){
3232
console.error(error);
3333
});
3434
}
35-
35+
export async function wholesearch(text:string){
36+
(window as any).__TAURI__.invoke(
37+
"search_try", {
38+
windowname:uio.appWindow.label,
39+
path: globals.pathInput.value,
40+
string: text
41+
})
42+
}
3643
export async function searchforit(text:string){
3744
// (window as any).__TAURI__.invoke(
3845
// "search_try", {

src/handleclick.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import setsendpath from './copynpaste';
22
import { copyToClipboard } from './ctc';
33
import uio, * as globals from './file-explorer';
4+
import { wholesearch } from './getpathoptions';
45
import { settableandtbody } from './listfiles';
56
import { loader } from './loader';
67
import { populateimmediatechildcount, populatesearchlist, reloadlist, reloadsize } from './menu_apis';
@@ -246,6 +247,9 @@ export function handleclicks(e:Event){
246247
case globals.recent:
247248
recentfiles();
248249
break;
250+
case document.getElementById("wholesearch") as HTMLButtonElement:
251+
wholesearch(globals.searchInput.value);
252+
break;
249253
case globals.reload:
250254
reloadlist();
251255
break;

src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
+
4949
</button>
5050
<input id="search-input" type="text" />
51+
<button id="wholesearch">Search</button>
5152
</div>
5253
<span id="setsofwhat" style="display: flex;">
5354

src/searchresult.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export function loadsearchresult(){
111111

112112
td1.textContent = file.name;
113113
td1.className = "td1";
114-
td1.dataset.value = file.name;
115-
td1.dataset.name = file.name;
116-
td1.dataset.path = file.path;
114+
tr.dataset.value = file.name;
115+
tr.dataset.name = file.name;
116+
tr.dataset.path = file.path;
117117

118118
td1.dataset.isDir = file.is_dir.toString();
119119
if (file.is_dir) {

0 commit comments

Comments
 (0)