content top component

This commit is contained in:
nixa 2016-05-02 14:49:35 +03:00
parent aae6dbcc23
commit 9fa15f15f0
6 changed files with 78 additions and 2 deletions

View file

@ -3,13 +3,13 @@ import {RouteConfig, Router} from 'angular2/router';
import {Dashboard} from './dashboard'; import {Dashboard} from './dashboard';
import {Ui} from './ui'; import {Ui} from './ui';
import {PageTop, Sidebar} from '../theme'; import {PageTop, ContentTop, Sidebar} from '../theme';
@Component({ @Component({
selector: 'pages', selector: 'pages',
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
styles: [], styles: [],
directives: [PageTop, Sidebar], directives: [PageTop, Sidebar, ContentTop],
template: ` template: `
<sidebar></sidebar> <sidebar></sidebar>
<page-top></page-top> <page-top></page-top>

View file

@ -0,0 +1,25 @@
import {Component, ViewEncapsulation} from 'angular2/core';
import {ThemeGlobal} from "../theme.global";
import {Subscription} from "rxjs/Subscription";
@Component({
selector: 'content-top',
styles: [require('./contentTop.scss')],
template: require('./contentTop.html'),
})
export class ContentTop {
activePageTitle = '';
private _themeGlobalSubscription:Subscription;
constructor(private _themeGlobal:ThemeGlobal) {
this._themeGlobalSubscription = this._themeGlobal.getDataStream().subscribe((data) => {
this.activePageTitle = data['menu.activeLink'] != null ? data['menu.activeLink'].title : this.activePageTitle;
});
}
ngOnDestroy() {
// prevent memory leak when component destroyed
this._themeGlobalSubscription.unsubscribe();
}
}

View file

@ -0,0 +1,9 @@
<div class="content-top clearfix">
<h1 class="al-title">{{ activePageTitle }}</h1>
<ul class="breadcrumb al-breadcrumb">
<li>
<a href="#/dashboard">Home</a></li>
<li>{{ activePageTitle }}</li>
</ul>
</div>

View file

@ -0,0 +1,40 @@
@import '../sass/conf/conf';
.content-top {
padding-top: 13px;
padding-bottom: 27px;
}
h1.al-title {
font-weight: $font-bold;
color: #ffffff;
float: left;
width: auto;
margin: 0;
padding: 0;
font-size: 24px;
text-transform: uppercase;
opacity: 0.9;
}
.al-breadcrumb {
background: none;
color: #ffffff;
padding: 0;
margin: 0;
float: right;
padding-top: 11px;
li {
font-size: 18px;
font-weight: $font-light;
}
}
.al-look {
float: right;
margin-right: 10px;
padding-top: 10px;
> a {
font-size: 19px;
}
}

View file

@ -0,0 +1 @@
export * from './contentTop.component';

View file

@ -1,3 +1,4 @@
export * from './pageTop'; export * from './pageTop';
export * from './msgCenter'; export * from './msgCenter';
export * from './sidebar'; export * from './sidebar';
export * from './contentTop';