file search working. opening not so much

This commit is contained in:
Iaphetes 2025-01-31 07:21:34 +01:00
parent 9b9c5add18
commit c87cf5c8ee
3 changed files with 8 additions and 6 deletions

View file

@ -22,7 +22,7 @@ pub fn _search_files(path: &Path, searchstring: &str, filter: &Vec<String>) -> V
if metadata.is_file() {
if entry_match(&dir_entry, searchstring, filter) {
let div = search_result_div_from_dir_entry(&dir_entry).to_html();
println!("{:?}", div);
// println!("{:?}", div);
search_results.push(div);
}
} else if metadata.is_dir() {
@ -66,9 +66,8 @@ fn entry_match(dir_entry: &DirEntry, searchstring: &str, filter: &Vec<String>) -
fn search_result_div_from_dir_entry(dir_entry: &DirEntry) -> HtmlTag {
let mut file_div = HtmlTag::new("div")
.with_class("filetree-node")
.with_id(&format!("{}", dir_entry.path().to_string_lossy()))
.with_attribute("style", "visibility: hidden; height: 0px;");
let mut file_button = HtmlTag::new("button").with_class("filetree-file-button");
.with_id(&format!("{}", dir_entry.path().to_string_lossy()));
let mut file_button = HtmlTag::new("button").with_class("file-search-button");
match dir_entry
.path()
.extension()