Merge branch 'master' into skeleton

This commit is contained in:
Sercan Yemen 2018-03-09 20:03:43 +03:00
commit da615585d0
2 changed files with 22 additions and 17 deletions

View File

@ -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();
}
} }
/** /**

View File

@ -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>