Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
jbomhold3 committed Dec 18, 2024
1 parent 4f5094a commit 3d64cbd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/BlazorStrap.V4/BlazorStrap.V4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageProjectUrl>https://blazorstrap.io/</PackageProjectUrl>
<RepositoryUrl>https://github.com/chanan/BlazorStrap</RepositoryUrl>
<RootNamespace>BlazorStrap.V4</RootNamespace>
<PackageVersion>5.2.103.121924</PackageVersion>
<PackageVersion>5.2.103.122024</PackageVersion>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap.V4/Components/Common/BSBreadcrumb.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else
</li>
}
}
@foreach (var item in Tree.Skip(_skip))
@foreach (var item in Tree.Skip(Skip))
{
if (NavigationManager?.Uri == item.Key)
{
Expand Down
11 changes: 1 addition & 10 deletions src/BlazorStrap.V4/Components/Common/BSBreadcrumb.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@ namespace BlazorStrap.V4
{
public partial class BSBreadcrumb : BSBreadcrumbBase
{
private int _skip = 0;
protected override string? LayoutClass => LayoutClassBuilder.Build(this);

protected override string? ClassBuilder => new CssBuilder("breadcrumb")
.AddClass(LayoutClass, !string.IsNullOrEmpty(LayoutClass))
.AddClass(Class, !string.IsNullOrEmpty(Class))
.Build().ToNullString();

protected override void OnInitialized()
{
base.OnInitialized();
if (Tree.Count > MaxItems)
{
_skip = Tree.Count - MaxItems;
}
}

}
}
2 changes: 1 addition & 1 deletion src/BlazorStrap.V5/BlazorStrap.V5.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageProjectUrl>https://blazorstrap.io/</PackageProjectUrl>
<RepositoryUrl>https://github.com/chanan/BlazorStrap</RepositoryUrl>
<RootNamespace>BlazorStrap.V5</RootNamespace>
<PackageVersion>5.2.103.121924</PackageVersion>
<PackageVersion>5.2.103.122024</PackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BlazorStrap.V5/Components/Common/BSBreadcrumb.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else
</li>
}
}
@foreach (var item in Tree.Skip(_skip))
@foreach (var item in Tree.Skip(Skip))
{
if (NavigationManager?.Uri == item.Key)
{
Expand Down
11 changes: 1 addition & 10 deletions src/BlazorStrap.V5/Components/Common/BSBreadcrumb.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@ namespace BlazorStrap.V5
{
public partial class BSBreadcrumb : BSBreadcrumbBase
{
private int _skip = 0;
protected override string? LayoutClass => LayoutClassBuilder.Build(this);

protected override string? ClassBuilder => new CssBuilder("breadcrumb")
.AddClass(LayoutClass, !string.IsNullOrEmpty(LayoutClass))
.AddClass(Class, !string.IsNullOrEmpty(Class))
.Build().ToNullString();

protected override void OnInitialized()
{
base.OnInitialized();
if (Tree.Count > MaxItems)
{
_skip = Tree.Count - MaxItems;
}
}

}
}
4 changes: 3 additions & 1 deletion src/BlazorStrap/Shared/Components/Common/BSBreadcrumbBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class BSBreadcrumbBase : BlazorStrapBase
protected abstract string? ClassBuilder { get; }

protected Dictionary<string, string> Tree { get; set; } = new();

protected int Skip { get; set; }

protected override void OnInitialized()
{
Expand All @@ -41,13 +41,15 @@ protected override void OnInitialized()

//Tree = GetPath(NavigationManager.Uri, BasePath, Labels, "https://localhost:7262/V5/" ?? "");
Tree = GetPath(NavigationManager.Uri, BasePath, Labels, NavigationManager?.BaseUri ?? "");
Skip = Tree.Count - MaxItems;
}

private void OnLocationChanged(object? sender, LocationChangedEventArgs e)
{
if (string.IsNullOrEmpty(BasePath)) return;
if (NavigationManager == null) return;
Tree = GetPath(NavigationManager.Uri, BasePath, Labels, NavigationManager?.BaseUri ?? "");
Skip = Tree.Count - MaxItems;
StateHasChanged();
}

Expand Down

0 comments on commit 3d64cbd

Please sign in to comment.