Copy CustomElement's polyfill of CustomEvent to HTMLImports

This commit is contained in:
Keanu Lee
2014-11-17 15:02:30 -08:00
parent 606609acf9
commit b0e653773d

View File

@@ -24,16 +24,15 @@ if (scope.useNative) {
return;
}
// IE shim for CustomEvent
// CustomEvent shim for IE
if (typeof window.CustomEvent !== 'function') {
window.CustomEvent = function(inType, dictionary) {
var e = document.createEvent('HTMLEvents');
e.initEvent(inType,
dictionary.bubbles === false ? false : true,
dictionary.cancelable === false ? false : true,
dictionary.detail);
window.CustomEvent = function(inType, params) {
params = params || {};
var e = document.createEvent('CustomEvent');
e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);
return e;
};
window.CustomEvent.prototype = window.Event.prototype;
}
// Initialize polyfill modules. Note, polyfill modules are loaded but not