summaryrefslogtreecommitdiffstats
path: root/src/polyfill.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/polyfill.js')
-rw-r--r--src/polyfill.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/polyfill.js b/src/polyfill.js
index d99ab76..5ab3153 100644
--- a/src/polyfill.js
+++ b/src/polyfill.js
@@ -1,16 +1,18 @@
// Add CustomEvent to IE9 and IE10
if (typeof window.CustomEvent !== 'function') {
// Code from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
- var CustomEvent = function(event, options) {
+ var CustomEventPoly = function(event, options) {
options = options || { bubbles: false, cancelable: false, detail: undefined }
var e = document.createEvent('CustomEvent')
e.initCustomEvent(event, options.bubbles, options.cancelable, options.detail)
return e
}
- CustomEvent.prototype = window.Event.prototype
+ CustomEventPoly.prototype = window.Event.prototype
- window.CustomEvent = CustomEvent
+ SVG.CustomEvent = CustomEventPoly
+} else {
+ SVG.CustomEvent = window.CustomEvent
}
// requestAnimationFrame / cancelAnimationFrame Polyfill with fallback based on Paul Irish