1 |
|
2 | /**
|
3 | * CustomEvent polyfill for IE 11
|
4 | */
|
5 | (function () {
|
6 |
|
7 | if ( typeof window.CustomEvent === "function" ) return false;
|
8 |
|
9 | function CustomEvent ( event, params ) {
|
10 | params = params || { bubbles: false, cancelable: false, detail: undefined };
|
11 | var evt = document.createEvent( 'CustomEvent' );
|
12 | evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
|
13 | return evt;
|
14 | }
|
15 |
|
16 | CustomEvent.prototype = window.Event.prototype;
|
17 |
|
18 | window.CustomEvent = CustomEvent;
|
19 | })();
|