summaryrefslogtreecommitdiffstats
path: root/src/polyfill.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-06-21 18:25:29 +0200
committerwout <wout@impinc.co.uk>2014-06-21 18:25:29 +0200
commit19b6fd4338246d1fd9ca4806e57c7aebcec63826 (patch)
tree3dd1d207de9f586f7e4d4cd36917e347ab022a9e /src/polyfill.js
parentbb0e6be2da0cea98c5303871c0be055f5f70d7a9 (diff)
downloadsvg.js-19b6fd4338246d1fd9ca4806e57c7aebcec63826.tar.gz
svg.js-19b6fd4338246d1fd9ca4806e57c7aebcec63826.zip
Removed all structural references
Diffstat (limited to 'src/polyfill.js')
-rw-r--r--src/polyfill.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/polyfill.js b/src/polyfill.js
new file mode 100644
index 0000000..3a3c25c
--- /dev/null
+++ b/src/polyfill.js
@@ -0,0 +1,14 @@
+// Add CustomEvent to IE9 and IE10
+if (typeof CustomEvent !== 'function') {
+ // Code from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
+ function CustomEvent (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
+
+ window.CustomEvent = CustomEvent
+} \ No newline at end of file