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
|
// Folded
|
||||||
@HostBinding('class.folded')
|
@HostBinding('class.folded')
|
||||||
@Input()
|
@Input()
|
||||||
folded: boolean;
|
set folded(value)
|
||||||
|
{
|
||||||
|
this._folded = value;
|
||||||
|
|
||||||
|
if ( value )
|
||||||
|
{
|
||||||
|
this.fold();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.unfold();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get folded()
|
||||||
|
{
|
||||||
|
return this._folded;
|
||||||
|
}
|
||||||
|
|
||||||
// Folded unfolded
|
// Folded unfolded
|
||||||
@HostBinding('class.unfolded')
|
@HostBinding('class.unfolded')
|
||||||
unfolded: boolean;
|
unfolded: boolean;
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
|
private _folded = false;
|
||||||
private _wasActive: boolean;
|
private _wasActive: boolean;
|
||||||
private _backdrop: HTMLElement | null = null;
|
private _backdrop: HTMLElement | null = null;
|
||||||
private _player: AnimationPlayer;
|
private _player: AnimationPlayer;
|
||||||
|
@ -270,8 +288,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
||||||
*/
|
*/
|
||||||
fold(): void
|
fold(): void
|
||||||
{
|
{
|
||||||
this.folded = true;
|
|
||||||
|
|
||||||
// Add a css class to the body
|
// Add a css class to the body
|
||||||
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded');
|
this.renderer.addClass(this.document.body, 'fuse-sidebar-folded');
|
||||||
}
|
}
|
||||||
|
@ -281,8 +297,6 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
||||||
*/
|
*/
|
||||||
unfold(): void
|
unfold(): void
|
||||||
{
|
{
|
||||||
this.folded = false;
|
|
||||||
|
|
||||||
// Remove the css class from the body
|
// Remove the css class from the body
|
||||||
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded');
|
this.renderer.removeClass(this.document.body, 'fuse-sidebar-folded');
|
||||||
}
|
}
|
||||||
|
@ -292,14 +306,7 @@ export class FuseSidebarComponent implements OnInit, OnDestroy
|
||||||
*/
|
*/
|
||||||
toggleFold(): void
|
toggleFold(): void
|
||||||
{
|
{
|
||||||
if ( this.folded )
|
this.folded = !this.folded;
|
||||||
{
|
|
||||||
this.unfold();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.fold();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button mat-button class="toggle-button-navbar mat-icon-button"
|
<button mat-button class="toggle-button-navbar mat-icon-button"
|
||||||
(click)="toggleSidebarFolded('navbar')"
|
(click)="toggleSidebarFolded('navbar')" fxHide.lt-lg>
|
||||||
fxHide.lt-lg>
|
|
||||||
<mat-icon>menu</mat-icon>
|
<mat-icon>menu</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button mat-button class="toggle-button-navbar mat-icon-button"
|
<button mat-button class="toggle-button-navbar mat-icon-button"
|
||||||
(click)="toggleSidebarOpened('navbar')"
|
(click)="toggleSidebarOpened('navbar')" fxHide.gt-md>
|
||||||
fxHide.gt-md>
|
|
||||||
<mat-icon>arrow_back</mat-icon>
|
<mat-icon>arrow_back</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user