mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
Remove the {navigation} import from the Shortcuts and inject it from the toolbar where we actually use the fuseShortcuts
This commit is contained in:
parent
ca42f71b0e
commit
831d48f5a3
|
@ -1,4 +1,4 @@
|
||||||
import { Component, ElementRef, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
import { Component, ElementRef, Input, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { ObservableMedia } from '@angular/flex-layout';
|
import { ObservableMedia } from '@angular/flex-layout';
|
||||||
import { CookieService } from 'ngx-cookie-service';
|
import { CookieService } from 'ngx-cookie-service';
|
||||||
|
@ -7,8 +7,6 @@ import { FuseMatchMediaService } from '@fuse/services/match-media.service';
|
||||||
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
import { FuseNavigationService } from '@fuse/components/navigation/navigation.service';
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
|
|
||||||
import { navigation } from 'app/navigation/navigation';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-shortcuts',
|
selector : 'fuse-shortcuts',
|
||||||
templateUrl: './shortcuts.component.html',
|
templateUrl: './shortcuts.component.html',
|
||||||
|
@ -25,6 +23,8 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||||
matchMediaSubscription: Subscription;
|
matchMediaSubscription: Subscription;
|
||||||
onConfigChanged: Subscription;
|
onConfigChanged: Subscription;
|
||||||
|
|
||||||
|
@Input() navigation: any;
|
||||||
|
|
||||||
@ViewChild('searchInput') searchInputField;
|
@ViewChild('searchInput') searchInputField;
|
||||||
@ViewChild('shortcuts') shortcutsEl: ElementRef;
|
@ViewChild('shortcuts') shortcutsEl: ElementRef;
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||||
private cookieService: CookieService
|
private cookieService: CookieService
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(navigation);
|
|
||||||
|
|
||||||
this.onConfigChanged =
|
this.onConfigChanged =
|
||||||
this.fuseConfig.onConfigChanged
|
this.fuseConfig.onConfigChanged
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
@ -50,6 +48,9 @@ export class FuseShortcutsComponent implements OnInit, OnDestroy
|
||||||
|
|
||||||
ngOnInit()
|
ngOnInit()
|
||||||
{
|
{
|
||||||
|
// Get the navigation items and flatten them
|
||||||
|
this.filteredNavigationItems = this.navigationItems = this.fuseNavigationService.getFlatNavigation(this.navigation);
|
||||||
|
|
||||||
const cookieExists = this.cookieService.check('FUSE2.shortcuts');
|
const cookieExists = this.cookieService.check('FUSE2.shortcuts');
|
||||||
|
|
||||||
if ( cookieExists )
|
if ( cookieExists )
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="px-8 px-mat-16">
|
<div class="px-8 px-mat-16">
|
||||||
<fuse-shortcuts></fuse-shortcuts>
|
<fuse-shortcuts [navigation]="navigation"></fuse-shortcuts>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { TranslateService } from '@ngx-translate/core';
|
||||||
import { FuseConfigService } from '@fuse/services/config.service';
|
import { FuseConfigService } from '@fuse/services/config.service';
|
||||||
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
|
import { FuseSidebarService } from '@fuse/components/sidebar/sidebar.service';
|
||||||
|
|
||||||
|
import { navigation } from 'app/navigation/navigation';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector : 'fuse-toolbar',
|
selector : 'fuse-toolbar',
|
||||||
templateUrl: './toolbar.component.html',
|
templateUrl: './toolbar.component.html',
|
||||||
|
@ -19,6 +21,7 @@ export class FuseToolbarComponent
|
||||||
showLoadingBar: boolean;
|
showLoadingBar: boolean;
|
||||||
horizontalNav: boolean;
|
horizontalNav: boolean;
|
||||||
noNav: boolean;
|
noNav: boolean;
|
||||||
|
navigation: any;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@ -87,6 +90,7 @@ export class FuseToolbarComponent
|
||||||
this.noNav = settings.layout.navigation === 'none';
|
this.noNav = settings.layout.navigation === 'none';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.navigation = navigation;
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSidebarOpened(key)
|
toggleSidebarOpened(key)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user