perfect scrollbar update on nav item toggle

+ iconset url fix
This commit is contained in:
Sercan Yemen 2017-08-22 15:42:11 +03:00
parent fcabc1fbff
commit 8cbc2f3ab7
2 changed files with 13 additions and 2 deletions

View File

@ -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 { Subscription } from 'rxjs/Subscription';
import { FuseMatchMedia } from '../../core/services/match-media.service'; import { FuseMatchMedia } from '../../core/services/match-media.service';
import { FuseNavbarService } from './navbar.service'; import { FuseNavbarService } from './navbar.service';
import { ObservableMedia } from '@angular/flex-layout'; import { ObservableMedia } from '@angular/flex-layout';
import { FuseMainComponent } from '../main.component'; import { FuseMainComponent } from '../main.component';
import { NavigationEnd, Router } from '@angular/router'; import { NavigationEnd, Router } from '@angular/router';
import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
import { FuseNavigationService } from '../../core/components/navigation/navigation.service';
@Component({ @Component({
selector : 'fuse-navbar', selector : 'fuse-navbar',
@ -19,12 +21,14 @@ export class FuseNavbarComponent implements OnInit, OnDestroy
@HostBinding('class.folded-open') isFoldedOpen: boolean; @HostBinding('class.folded-open') isFoldedOpen: boolean;
@HostBinding('class.initialized') initialized: boolean; @HostBinding('class.initialized') initialized: boolean;
@Input('folded') foldedByDefault = false; @Input('folded') foldedByDefault = false;
@ViewChild(PerfectScrollbarDirective) perfectScrollbarDirective;
matchMediaWatcher: Subscription; matchMediaWatcher: Subscription;
constructor( constructor(
private fuseMainComponentEl: FuseMainComponent, private fuseMainComponentEl: FuseMainComponent,
private fuseMatchMedia: FuseMatchMedia, private fuseMatchMedia: FuseMatchMedia,
private fuseNavigationService: FuseNavigationService,
private navBarService: FuseNavbarService, private navBarService: FuseNavbarService,
public media: ObservableMedia, public media: ObservableMedia,
private router: Router private router: Router
@ -32,6 +36,13 @@ export class FuseNavbarComponent implements OnInit, OnDestroy
{ {
navBarService.setNavBar(this); navBarService.setNavBar(this);
this.fuseNavigationService.onNavCollapseToggled.subscribe(() => {
setTimeout(() => {
this.perfectScrollbarDirective.update();
}, 310);
});
this.matchMediaWatcher = this.matchMediaWatcher =
this.fuseMatchMedia.onMediaChange this.fuseMatchMedia.onMediaChange
.subscribe((mediaStep) => { .subscribe((mediaStep) => {

View File

@ -11,7 +11,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="/assets/icons/meteocons/style.css" rel="stylesheet"> <link href="assets/icons/meteocons/style.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<!-- FUSE Splash Screen CSS --> <!-- FUSE Splash Screen CSS -->