Created
May 4, 2018 22:00
-
-
Save rockinghelvetica/b9b8972562c46b11ef1d2c88053268cd 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