Skip to content

Commit 7d3ac79

Browse files
feat(Tab): update FullScreen targetId (#5996)
* style: 更新样式 * feat: 移除全屏 Id 设置 * refactor: 更新扩展方法 * test: 更新单元测试 * test: 更新单元测试 * test: 更新单元测试 * chore: bump version 9.6.1 Co-Authored-By: UnicronOrigin <[email protected]> --------- Co-authored-by: UnicronOrigin <[email protected]>
1 parent 91d0f52 commit 7d3ac79

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.6.1-beta03</Version>
4+
<Version>9.6.1</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/FullScreen/FullScreenButton.razor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
display: inline-block;
77
}
88

9-
:not(:root):fullscreen {
9+
:fullscreen {
1010
.bb-fs-on {
1111
display: inline-block;
1212
}

src/BootstrapBlazor/Components/Tab/Tab.razor

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ else
8787
@if (ShowFullscreenToolbarButton)
8888
{
8989
<div class="tabs-nav-toolbar-button tabs-nav-toolbar-fs">
90-
<FullScreenButton TargetId="@Id"
91-
Icon="@FullscreenToolbarButtonIcon"
90+
<FullScreenButton Icon="@FullscreenToolbarButtonIcon"
9291
TooltipText="@FullscreenToolbarTooltipText"
9392
TooltipPlacement="Placement.Bottom" TooltipTrigger="hover"></FullScreenButton>
9493
</div>
@@ -194,7 +193,7 @@ else
194193
{
195194
@if (ShowFullScreen && item.ShowFullScreen)
196195
{
197-
<FullScreenButton TargetId="@GetIdByTabItem(item)"></FullScreenButton>
196+
<FullScreenButton></FullScreenButton>
198197
}
199198
@if (ShowClose && item.Closable)
200199
{

src/BootstrapBlazor/Components/Tab/Tab.razor.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,6 @@ public async Task DragItemCallback(int originIndex, int currentIndex)
10591059
}
10601060
}
10611061

1062-
private string GetIdByTabItem(TabItem item) => ComponentIdGenerator.Generate(item);
1063-
10641062
private async Task OnRefreshAsync()
10651063
{
10661064
// refresh the active tab item
@@ -1120,10 +1118,7 @@ private Task OnCloseAll(ContextMenuItem item, object? context)
11201118

11211119
private async Task OnFullScreen(ContextMenuItem item, object? context)
11221120
{
1123-
if (context is TabItem tabItem)
1124-
{
1125-
await FullScreenService.ToggleById(GetIdByTabItem(tabItem));
1126-
}
1121+
await FullScreenService.ToggleById();
11271122
}
11281123

11291124
private async Task OnContextMenu(MouseEventArgs e, TabItem item)

src/BootstrapBlazor/Extensions/FullScreenServiceExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ public static class FullScreenServiceExtensions
2424
/// <param name="id"></param>
2525
/// <param name="service"></param>
2626
/// <returns></returns>
27-
public static Task ToggleById(this FullScreenService service, string id) => service.Toggle(new() { Id = id });
27+
public static Task ToggleById(this FullScreenService service, string? id = null) => service.Toggle(new() { Id = id });
2828
}

0 commit comments

Comments
 (0)