Skip to content

Commit

Permalink
update headroom
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed May 20, 2017
1 parent 53d6915 commit d958dcb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions headroom/headroom.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
this.elems[i].classList.remove(this.unPinnedClass, this.initialClass);
}

dom.removeEventListener(this.scroller, this.scroller.getScrollEventName(), this.debouncer, {
var scrollEventName = this.scroller.getScrollEventName ? this.scroller.getScrollEventName() : 'scroll';

dom.removeEventListener(this.scroller, scrollEventName, this.debouncer, {
capture: false,
passive: true
});
Expand All @@ -136,7 +138,10 @@ define(['dom', 'layoutManager', 'browser', 'css!./headroom'], function (dom, lay
if (!this.initialised) {
this.lastKnownScrollY = this.getScrollY();
this.initialised = true;
dom.addEventListener(this.scroller, this.scroller.getScrollEventName(), this.debouncer, {

var scrollEventName = this.scroller.getScrollEventName ? this.scroller.getScrollEventName() : 'scroll';

dom.addEventListener(this.scroller, scrollEventName, this.debouncer, {
capture: false,
passive: true
});
Expand Down

0 comments on commit d958dcb

Please sign in to comment.