diff --git a/Obsidian/Shared/TreeWadItem.razor b/Obsidian/Shared/TreeWadItem.razor index 5763394..89a37d6 100644 --- a/Obsidian/Shared/TreeWadItem.razor +++ b/Obsidian/Shared/TreeWadItem.razor @@ -146,7 +146,9 @@ private void OnRowDoubleClick(MouseEventArgs e) { if (this.Item is WadFolderModel folder) - OnToggleExpand(); + ToggleExpand(); + + this.Root.RefreshState(); } private void OnCheckedChanged(bool value) @@ -156,12 +158,24 @@ this.Root.RefreshState(); } - private void OnToggleExpand() + private void OnToggleExpand(MouseEventArgs e) { - this.Item.IsExpanded = !this.Item.IsExpanded; + ToggleExpand(); + + if (e.ShiftKey) + { + foreach (WadItemModel item in this.Item.TraverseFlattenedItems()) + item.IsExpanded = this.Item.IsExpanded; + } + this.Root.RefreshState(); } + private void ToggleExpand() + { + this.Item.IsExpanded = !this.Item.IsExpanded; + } + private async Task CopyNameToClipboard() { await this.JsRuntime.InvokeVoidAsync("navigator.clipboard.writeText", this.Item.Name);