Skip to content
This repository was archived by the owner on Jul 3, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/scrollsnap-polyfill.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function(w, doc, undefined) {
window.makeScrollsnapPolyfill = (function(w, doc, undefined) {
Copy link
Copy Markdown

@wjramos wjramos Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I agree with binding to window.

CommonJS module.exports may be a better option

// Enable strict mode
'use strict';

Expand Down Expand Up @@ -668,10 +668,13 @@
* @type Polyfill
* @see https://github.com/philipwalton/polyfill
*/
var pf = new Polyfill({
declarations:["scroll-snap-type:*", "scroll-snap-point-y:*", "scroll-snap-coordinate:*", "scroll-snap-destination:*"]
})
.doMatched(doMatched)
.undoUnmatched(undoUnmatched);

function makeScrollsnapPolyfill() {
var pf = new Polyfill({
declarations:["scroll-snap-type:*", "scroll-snap-point-y:*", "scroll-snap-coordinate:*", "scroll-snap-destination:*"]
})
.doMatched(doMatched)
.undoUnmatched(undoUnmatched);
}
makeScrollsnapPolyfill();
return makeScrollsnapPolyfill;
}(window, document));