mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
Fixed: Sidebar folded doesn't push the content if activated programmatically
This commit is contained in:
parent
9c0f89953c
commit
096e1b47d2
|
@ -38,13 +38,31 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||
// Folded
|
||||
@HostBinding('class.folded')
|
||||
@Input()
|
||||
folded: boolean;
|
||||
set folded(value)
|
||||
{
|
||||
this._folded = value;
|
||||
|
||||
if ( value )
|
||||
{
|
||||
this.fold();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.unfold();
|
||||
}
|
||||
}
|
||||
|
||||
get folded()
|
||||
{
|
||||
return this._folded;
|
||||
}
|
||||
|
||||
// Folded unfolded
|
||||
@HostBinding('class.unfolded')
|
||||
unfolded: boolean;
|
||||
|
||||
// Private
|
||||
private _folded = false;
|
||||
private _wasActive: boolean;
|
||||
private _backdrop: HTMLElement | null = null;
|
||||
private _player: AnimationPlayer;
|
||||
|
@ -270,8 +288,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||
*/
|
||||
fold(): void
|
||||
{
|
||||
this.folded = true;
|
||||
|
||||
// Add a css class to the body
|
||||
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded');
|
||||
}
|
||||
|
@ -281,8 +297,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||
*/
|
||||
unfold(): void
|
||||
{
|
||||
this.folded = false;
|
||||
|
||||
// Remove the css class from the body
|
||||
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded');
|
||||
}
|
||||
|
@ -292,14 +306,7 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
|||
*/
|
||||
toggleFold(): void
|
||||
{
|
||||
if ( this.folded )
|
||||
{
|
||||
this.unfold();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fold();
|
||||
}
|
||||
this.folded = !this.folded;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,14 +10,12 @@
|
|||
</div>
|
||||
|
||||
<button mat-button class="toggle-button-navbar mat-icon-button"
|
||||
(click)="toggleSidebarFolded('navbar')"
|
||||
fxHide.lt-lg>
|
||||
(click)="toggleSidebarFolded('navbar')" fxHide.lt-lg>
|
||||
<mat-icon>menu</mat-icon>
|
||||
</button>
|
||||
|
||||
<button mat-button class="toggle-button-navbar mat-icon-button"
|
||||
(click)="toggleSidebarOpened('navbar')"
|
||||
fxHide.gt-md>
|
||||
(click)="toggleSidebarOpened('navbar')" fxHide.gt-md>
|
||||
<mat-icon>arrow_back</mat-icon>
|
||||
</button>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user