Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2002 from cormacmccarthy/master
Browse files Browse the repository at this point in the history
adds polyfill for Event for IE
  • Loading branch information
Christopher McCulloh authored Jun 28, 2017
2 parents 7f63745 + 208260d commit 82e972b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global QUnit:false, module:false, test:false, asyncTest:false, expect:false */
/* global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false */
/* global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false */
define(function treeDataFactory (require) {
define(function helpersFactory (require) {
var $ = require('jquery');

var KEYMAP = {
Expand Down
15 changes: 15 additions & 0 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ define(function testWrapper (require) {
};
});

(function polyFillEventForIE () {
if ( typeof window.Event === 'function' ) return false;

function Event ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'Event' );
evt.initEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
}

Event.prototype = window.Event.prototype;

window.Event = Event;
})();

require('moment');
require('./test/checkbox-test');
require('./test/combobox-test');
Expand Down

0 comments on commit 82e972b

Please sign in to comment.