Fixie stickie

This commit is contained in:
Max Lynch
2015-10-30 09:53:46 -05:00
parent 9b9c820b2a
commit c23d0988aa
3 changed files with 3 additions and 38 deletions

View File

@ -9,8 +9,6 @@ import {ScrollTo} from '../../animations/scroll-to';
import {FeatureDetect} from '../../util/feature-detect';
import {StickyPoly} from './sticky-poly';
console.log(StickyPoly);
/**
* The Content component provides an easy to use content area that can be configured to use Ionic's custom Scroll View, or the built in overflow scrolling of the browser.
*
@ -63,9 +61,7 @@ export class Content extends Ion {
setTimeout(() => {
if(!this.featureDetect.has('sticky')) {
console.log('Enabling sticky polyfill');
this._sticky = StickyPoly(this.scrollElement);
//this._sticky.init();
}
})
}

View File

@ -1,33 +0,0 @@
import {Content} from './content';
export class StickyPolyfill {
constructor(private content: Content) {
this._els = [];
}
init() {
let handleScroll = (event) => {
let t = event.target;
let top = t.scrollTop;
console.log(top);
}
this._scrollListener = this.content.addScrollEventListener(handleScroll);
}
onDestroy() {
if(this._scrollListener) {
// Remove the old listener
this._scrollListener();
}
}
add(element: Element) {
this._els.push(this.initElement(element))
}
remove(element: Element) {
}
initElement(element) {
}
}

View File

@ -44,7 +44,9 @@ export class ItemGroupTitle {
}
onInit() {
setTimeout(() => {
this.content.getStickyPolyfill().add(this.elementRef.nativeElement);
if(this.content.getStickyPolyfill()) {
this.content.getStickyPolyfill().add(this.elementRef.nativeElement);
}
})
}
}