fuse-angular/src/app/main/toolbar/toolbar.component.ts

86 lines
2.1 KiB
TypeScript
Raw Normal View History

2017-07-13 14:43:22 +00:00
import { Component } from '@angular/core';
2017-07-31 13:32:58 +00:00
import { NavigationEnd, NavigationStart, Router } from '@angular/router';
@Component({
selector : 'fuse-toolbar',
templateUrl: './toolbar.component.html',
styleUrls : ['./toolbar.component.scss']
})
2017-07-13 14:43:22 +00:00
export class FuseToolbarComponent
{
2017-07-31 13:32:58 +00:00
userStatusOptions: any[];
languages: any;
selectedLanguage: any;
showSpinner: boolean;
constructor(private router: Router)
{
2017-07-31 13:32:58 +00:00
this.userStatusOptions = [
{
'title': 'Online',
'icon' : 'icon-checkbox-marked-circle',
'color': '#4CAF50'
},
{
'title': 'Away',
'icon' : 'icon-clock',
'color': '#FFC107'
},
{
'title': 'Do not Disturb',
'icon' : 'icon-minus-circle',
'color': '#F44336'
},
{
'title': 'Invisible',
'icon' : 'icon-checkbox-blank-circle-outline',
'color': '#BDBDBD'
},
{
'title': 'Offline',
'icon' : 'icon-checkbox-blank-circle-outline',
'color': '#616161'
}
];
this.languages = [
{
'id' : 'en',
'title': 'English',
'flag' : 'us'
},
{
'id' : 'es',
'title': 'Spanish',
'flag' : 'es'
},
{
'id' : 'tr',
'title': 'Turkish',
'flag' : 'tr'
}
];
this.selectedLanguage = this.languages[0];
router.events.subscribe(
(event) => {
if ( event instanceof NavigationStart )
{
this.showSpinner = true;
}
if ( event instanceof NavigationEnd )
{
this.showSpinner = false;
}
});
}
2017-08-07 11:27:34 +00:00
search(value)
{
// Do your search here...
console.log(value);
}
}