From c23d0988aa20104fbcad40eb3fb920f9571a3a2a Mon Sep 17 00:00:00 2001 From: Max Lynch Date: Fri, 30 Oct 2015 09:53:46 -0500 Subject: [PATCH] Fixie stickie --- ionic/components/content/content.ts | 4 ---- ionic/components/content/sticky.ts | 33 ----------------------------- ionic/components/item/item-group.ts | 4 +++- 3 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 ionic/components/content/sticky.ts diff --git a/ionic/components/content/content.ts b/ionic/components/content/content.ts index 3a03905f37..e14309711e 100644 --- a/ionic/components/content/content.ts +++ b/ionic/components/content/content.ts @@ -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(); } }) } diff --git a/ionic/components/content/sticky.ts b/ionic/components/content/sticky.ts deleted file mode 100644 index 359f53f93a..0000000000 --- a/ionic/components/content/sticky.ts +++ /dev/null @@ -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) { - } -} diff --git a/ionic/components/item/item-group.ts b/ionic/components/item/item-group.ts index d75aefe58c..7ed5b0854c 100644 --- a/ionic/components/item/item-group.ts +++ b/ionic/components/item/item-group.ts @@ -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); + } }) } }