Skip to content

Commit

Permalink
rm collapsed from button
Browse files Browse the repository at this point in the history
  • Loading branch information
tesar-tech committed Dec 12, 2024
1 parent dff2733 commit fa41a14
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions Source/Blazorise.Bootstrap5/Components/Button.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,8 @@ namespace Blazorise.Bootstrap5.Components;

public class Button : Blazorise.Button
{
#region Members

bool collapseVisible;

#endregion

#region Methods

protected override void BuildClasses( ClassBuilder builder )
{
if ( ParentCollapseHeader?.ParentCollapse != null )
{
// if ( ParentCollapseHeader.ParentCollapse.InsideAccordion )
// builder.Append( "accordion-button" );

if ( !CollapseVisible )
builder.Append( "collapsed" );
}

base.BuildClasses( builder );
}

protected override void BuildRenderTree( RenderTreeBuilder builder )
{
builder
Expand Down Expand Up @@ -59,11 +39,6 @@ protected override void BuildRenderTree( RenderTreeBuilder builder )
}
}

if ( ParentCollapseHeader?.ParentCollapse != null )
{
builder.AriaExpanded( ParentCollapseHeader.ParentCollapse.Visible.ToString().ToLowerInvariant() );
}

builder.OnClick( this, EventCallback.Factory.Create<MouseEventArgs>( this, ClickHandler ) );
builder.OnClickPreventDefault( Type == ButtonType.Link && To != null && To.StartsWith( "#" ) );

Expand Down Expand Up @@ -99,27 +74,4 @@ protected override RenderFragment ProvideDefaultLoadingTemplate()

#endregion

#region Properties

/// <summary>
/// Gets or sets the content visibility.
/// </summary>
[CascadingParameter( Name = "CollapseVisible" )]
public bool CollapseVisible
{
get => collapseVisible;
set
{
collapseVisible = value;

DirtyClasses();
}
}

/// <summary>
/// Gets or sets the cascaded parent collapse header component.
/// </summary>
[CascadingParameter] protected CollapseHeader ParentCollapseHeader { get; set; }

#endregion
}

0 comments on commit fa41a14

Please sign in to comment.