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

adds polyfill for Event for IE #2002

Merged
merged 1 commit into from
Jun 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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