Skip to content

Commit c2b3a9f

Browse files
committed
modify
1 parent 92a99d0 commit c2b3a9f

File tree

2 files changed

+10
-41
lines changed

2 files changed

+10
-41
lines changed

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "material2-dev"
4+
}
5+
}

src/lib/sticky-header/sticky-header-dir.ts

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
import {
2-
Component,
3-
Directive,
4-
Input,
5-
Output,
6-
EventEmitter,
7-
OnInit,
8-
OnDestroy,
9-
AfterViewInit,
10-
ElementRef,
11-
Injectable,
12-
Optional,
13-
Renderer2,
14-
ViewContainerRef,} from '@angular/core';
1+
import {Component, Directive, Input, Output, EventEmitter, OnInit, OnDestroy, AfterViewInit, ElementRef, Injectable, Optional} from '@angular/core';
152

163
import {Observable} from 'rxjs/Observable';
174
import {ScrollDispatcher} from '../core/overlay/scroll/scroll-dispatcher';
@@ -20,44 +7,21 @@ import {Subject} from 'rxjs/Subject';
207

218

229
@Directive({
23-
selector: '[md-sticky-viewport], [cdkStickyViewport], [cdkStickyRegion]',
10+
selector: '[cdkStickyRegion]',
2411
})
25-
26-
27-
@Injectable()
28-
export class StickyParentDirective implements OnInit, OnDestroy, AfterViewInit {
29-
30-
// The parent element, which with the 'md-sticky-viewport' tag
31-
private pelem: any;
32-
33-
constructor(private element: ElementRef) {
34-
this.pelem = element.nativeElement;
35-
}
36-
37-
ngOnInit(): void {
38-
this.pelem.classList.add('sticky-parent');
39-
}
40-
41-
ngAfterViewInit(): void {
42-
43-
}
44-
45-
ngOnDestroy(): void {
46-
this.pelem.classList.remove('sticky-parent');
47-
}
12+
export class StickyParentDirective {
13+
constructor(private element: ElementRef) { }
4814

4915
getElementRef(): ElementRef {
5016
return this.element;
5117
}
5218
}
5319

5420

55-
5621
@Directive({
57-
selector: '[md-sticky], [cdkSticky], [cdkStickyHeader]',
22+
selector: '[cdkStickyHeader]',
5823
})
5924

60-
6125
@Injectable()
6226
export class StickyHeaderDirective implements OnInit, OnDestroy, AfterViewInit {
6327

0 commit comments

Comments
 (0)