From ac7e6f75bc796285a216fec991f9198722d90924 Mon Sep 17 00:00:00 2001 From: Sercan Yemen Date: Mon, 16 Oct 2017 10:08:40 +0300 Subject: [PATCH] Added theme options openBar function to the navigation as an example + Removed duplicate Black and White tabs from colors --- .../theme-options/theme-options.component.ts | 23 ++++++++++ .../navigation/navigation.component.html | 46 +++++++++---------- .../content/ui/colors/colors.component.html | 6 --- 3 files changed, 46 insertions(+), 29 deletions(-) diff --git a/src/app/core/components/theme-options/theme-options.component.ts b/src/app/core/components/theme-options/theme-options.component.ts index 15c6fbc7..b84260ef 100644 --- a/src/app/core/components/theme-options/theme-options.component.ts +++ b/src/app/core/components/theme-options/theme-options.component.ts @@ -3,6 +3,7 @@ import { style, animate, AnimationBuilder, AnimationPlayer } from '@angular/anim import { Subscription } from 'rxjs/Subscription'; import { FuseConfigService } from '../../services/config.service'; import { fuseAnimations } from '../../animations'; +import { FuseNavigationService } from '../navigation/navigation.service'; @Component({ selector : 'fuse-theme-options', @@ -26,6 +27,7 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy constructor( private animationBuilder: AnimationBuilder, private fuseConfig: FuseConfigService, + private navigationService: FuseNavigationService, private renderer: Renderer2 ) { @@ -38,6 +40,27 @@ export class FuseThemeOptionsComponent implements OnInit, OnDestroy this.fuseSettings = newSettings; } ); + + // Get the nav model and add customize nav item + // that opens the bar programmatically + const navModel = this.navigationService.getNavigationModel(); + + navModel.push({ + 'id' : 'custom-function', + 'title' : 'Custom Function', + 'type' : 'group', + 'children': [ + { + 'id' : 'customize', + 'title' : 'Customize', + 'type' : 'item', + 'icon' : 'settings', + 'function': () => { + this.openBar(); + } + } + ] + }); } ngOnInit() diff --git a/src/app/main/content/components/navigation/navigation.component.html b/src/app/main/content/components/navigation/navigation.component.html index 1b4f66df..cbb42e13 100644 --- a/src/app/main/content/components/navigation/navigation.component.html +++ b/src/app/main/content/components/navigation/navigation.component.html @@ -48,15 +48,15 @@ @@ -69,16 +69,16 @@ @@ -91,10 +91,10 @@ diff --git a/src/app/main/content/ui/colors/colors.component.html b/src/app/main/content/ui/colors/colors.component.html index 98cdeb81..ba0d558c 100644 --- a/src/app/main/content/ui/colors/colors.component.html +++ b/src/app/main/content/ui/colors/colors.component.html @@ -39,12 +39,6 @@ - - - {{color}} - - -