Skip to content
Permalink
Browse files

Merge pull request #538 from sebastian-marinescu/patch-1

Use passive scroll-listener
  • Loading branch information...
arlogilbert committed May 23, 2019
2 parents 46ac15e + 370fcea commit ee650f02e87c7a1e6bf5475950ec679a8a4e79b1
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/cookieconsent.js
@@ -1036,14 +1036,14 @@
setStatus(cc.status.dismiss);
close(true);

window.removeEventListener('scroll', onWindowScroll);
window.removeEventListener('scroll', onWindowScroll, { passive: true });
this.onWindowScroll = null;
}
};

if (this.options.enabled) {
this.onWindowScroll = onWindowScroll;
window.addEventListener('scroll', onWindowScroll);
window.addEventListener('scroll', onWindowScroll, { passive: true });
}
}

0 comments on commit ee650f0

Please sign in to comment.
You can’t perform that action at this time.