From 096e1b47d2abca2b036562ce54f83db10b88c619 Mon Sep 17 00:00:00 2001 From: Sercan Yemen Date: Fri, 9 Mar 2018 20:03:12 +0300 Subject: [PATCH] Fixed: Sidebar folded doesn't push the content if activated programmatically --- .../components/sidebar/sidebar.component.ts | 33 +++++++++++-------- src/app/main/navbar/navbar.component.html | 6 ++-- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/@fuse/components/sidebar/sidebar.component.ts b/src/@fuse/components/sidebar/sidebar.component.ts index 5b410ce7..cff12192 100644 --- a/src/@fuse/components/sidebar/sidebar.component.ts +++ b/src/@fuse/components/sidebar/sidebar.component.ts @@ -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; } /** diff --git a/src/app/main/navbar/navbar.component.html b/src/app/main/navbar/navbar.component.html index 7eabc890..cdaab1a1 100644 --- a/src/app/main/navbar/navbar.component.html +++ b/src/app/main/navbar/navbar.component.html @@ -10,14 +10,12 @@