Created
May 4, 2018 22:01
-
-
Save rockinghelvetica/00b9f7b5c97a16d3de75ba99192ff05c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// POLYFILLS | |
// Event.composedPath | |
// Possibly normalize to add window to Safari's chain, as it does not? | |
(function(E, d, w) { | |
if(!E.composedPath) { | |
E.composedPath = function() { | |
if (this.path) { | |
return this.path; | |
} | |
var target = this.target; | |
this.path = []; | |
while (target.parentNode !== null) { | |
this.path.push(target); | |
target = target.parentNode; | |
} | |
this.path.push(d, w); | |
return this.path; | |
} | |
} | |
})(Event.prototype, document, window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment