mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
scrollPosition - baScrollPosition
This commit is contained in:
parent
8b673b1f48
commit
5f360a73a8
6 changed files with 12 additions and 11 deletions
|
|
@ -3,13 +3,13 @@ import {Component, ViewEncapsulation} from '@angular/core';
|
||||||
import {AppState} from '../../../app.state';
|
import {AppState} from '../../../app.state';
|
||||||
import {ProfilePicturePipe} from '../../pipes';
|
import {ProfilePicturePipe} from '../../pipes';
|
||||||
import {MsgCenter} from '../../components/msgCenter';
|
import {MsgCenter} from '../../components/msgCenter';
|
||||||
import {ScrollPosition} from '../../directives';
|
import {BaScrollPosition} from '../../directives';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-top',
|
selector: 'page-top',
|
||||||
styles: [require('./pageTop.scss')],
|
styles: [require('./pageTop.scss')],
|
||||||
template: require('./pageTop.html'),
|
template: require('./pageTop.html'),
|
||||||
directives: [MsgCenter, ScrollPosition],
|
directives: [MsgCenter, BaScrollPosition],
|
||||||
pipes: [ProfilePicturePipe],
|
pipes: [ProfilePicturePipe],
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<div class="page-top clearfix" scrollPosition maxHeight="50" (scrollChange)="scrolledChanged($event)"
|
<div class="page-top clearfix" baScrollPosition maxHeight="50" (scrollChange)="scrolledChanged($event)"
|
||||||
[ngClass]="{scrolled: isScrolled}">
|
[ngClass]="{scrolled: isScrolled}">
|
||||||
<a href="#/pages/dashboard" class="al-logo clearfix"><span>ng2-</span>admin</a>
|
<a href="#/pages/dashboard" class="al-logo clearfix"><span>ng2-</span>admin</a>
|
||||||
<a (click)="toggleMenu()" class="collapse-menu-link ion-navicon"></a>
|
<a (click)="toggleMenu()" class="collapse-menu-link ion-navicon"></a>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
import {Directive, Input, Output, EventEmitter, HostListener} from '@angular/core';
|
import {Directive, Input, Output, EventEmitter, HostListener} from '@angular/core';
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
selector: '[scrollPosition]'
|
selector: '[baScrollPosition]'
|
||||||
})
|
})
|
||||||
export class ScrollPosition {
|
export class BaScrollPosition {
|
||||||
@Input() maxHeight:Number;
|
|
||||||
@Output() scrollChange:EventEmitter<Boolean> = new EventEmitter<Boolean>();
|
|
||||||
|
|
||||||
private _isScrolled:Boolean;
|
@Input() public maxHeight:number;
|
||||||
|
@Output() public scrollChange:EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||||
|
|
||||||
ngOnInit() {
|
private _isScrolled:boolean;
|
||||||
|
|
||||||
|
public ngOnInit():void {
|
||||||
this.onWindowScroll();
|
this.onWindowScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
1
src/app/theme/directives/baScrollPosition/index.ts
Normal file
1
src/app/theme/directives/baScrollPosition/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export * from './baScrollPosition.directive.ts';
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
export * from './scrollPosition';
|
export * from './baScrollPosition';
|
||||||
export * from './baThemeRun';
|
export * from './baThemeRun';
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
export * from './scrollPosition.directive.ts';
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue