Skip to content

Commit 93723fd

Browse files
author
Adam Argyle
committed
slimmer handling of a non-upgrade path
1 parent de64065 commit 93723fd

9 files changed

Lines changed: 9 additions & 14 deletions

dist/scrollyfills.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
var n="onscrollend"in window,e=new Event("scrollend");exports.scrollend=function(t){n?t.addEventListener("scrollend",function(){t.dispatchEvent(e)}):t.addEventListener("scroll",function(){clearTimeout(t.scrollEndTimer),t.scrollEndTimer=setTimeout(function(){t.dispatchEvent(e)},100)})};
1+
var n="onscrollend"in window,e=new Event("scrollend");exports.scrollend=function(o){n||o.addEventListener("scroll",function(){clearTimeout(o.scrollEndTimer),o.scrollEndTimer=setTimeout(function(){o.dispatchEvent(e)},100)})};
22
//# sourceMappingURL=scrollyfills.cjs.map

dist/scrollyfills.cjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.modern.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.modern.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scrollyfills.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scrollend.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ const supported = "onscrollend" in window
22
const scrollendEvent = new Event('scrollend')
33

44
export const scrollend = scrollport => {
5-
if (supported) {
6-
scrollport.addEventListener('scrollend', () => {
7-
scrollport.dispatchEvent(scrollendEvent)
8-
})
9-
}
10-
else {
5+
if (!supported) {
116
scrollport.addEventListener('scroll', () => {
127
clearTimeout(scrollport.scrollEndTimer)
138

0 commit comments

Comments
 (0)