From 8cbc2f3ab73acdf0406785c0e79f3976d847d7de Mon Sep 17 00:00:00 2001 From: Sercan Yemen Date: Tue, 22 Aug 2017 15:42:11 +0300 Subject: [PATCH] perfect scrollbar update on nav item toggle + iconset url fix --- src/app/main/navbar/navbar.component.ts | 13 ++++++++++++- src/index.html | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/app/main/navbar/navbar.component.ts b/src/app/main/navbar/navbar.component.ts index f813570e..37ed4168 100644 --- a/src/app/main/navbar/navbar.component.ts +++ b/src/app/main/navbar/navbar.component.ts @@ -1,10 +1,12 @@ -import { Component, HostBinding, HostListener, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; +import { Component, HostBinding, HostListener, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; import { Subscription } from 'rxjs/Subscription'; import { FuseMatchMedia } from '../../core/services/match-media.service'; import { FuseNavbarService } from './navbar.service'; import { ObservableMedia } from '@angular/flex-layout'; import { FuseMainComponent } from '../main.component'; import { NavigationEnd, Router } from '@angular/router'; +import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; +import { FuseNavigationService } from '../../core/components/navigation/navigation.service'; @Component({ selector : 'fuse-navbar', @@ -19,12 +21,14 @@ export class FuseNavbarComponent implements OnInit, OnDestroy @HostBinding('class.folded-open') isFoldedOpen: boolean; @HostBinding('class.initialized') initialized: boolean; @Input('folded') foldedByDefault = false; + @ViewChild(PerfectScrollbarDirective) perfectScrollbarDirective; matchMediaWatcher: Subscription; constructor( private fuseMainComponentEl: FuseMainComponent, private fuseMatchMedia: FuseMatchMedia, + private fuseNavigationService: FuseNavigationService, private navBarService: FuseNavbarService, public media: ObservableMedia, private router: Router @@ -32,6 +36,13 @@ export class FuseNavbarComponent implements OnInit, OnDestroy { navBarService.setNavBar(this); + this.fuseNavigationService.onNavCollapseToggled.subscribe(() => { + + setTimeout(() => { + this.perfectScrollbarDirective.update(); + }, 310); + }); + this.matchMediaWatcher = this.fuseMatchMedia.onMediaChange .subscribe((mediaStep) => { diff --git a/src/index.html b/src/index.html index 7ef42e29..ee0a4856 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@ - +