Skip to content

Commit

Permalink
better tab fold
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangpengHao committed Dec 4, 2024
1 parent eae516d commit 06b1646
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/file_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ pub fn FileReader(
let (is_folded, set_is_folded) = create_signal(false);

let set_active_tab = move |tab: &str| {
set_active_tab.set(tab.to_string());
set_is_folded.set(false);
if active_tab.get() == tab {
set_is_folded.set(!is_folded.get());
} else {
set_active_tab.set(tab.to_string());
set_is_folded.set(false);
}
};

let on_file_select = move |ev: web_sys::Event| {
Expand Down

0 comments on commit 06b1646

Please sign in to comment.