Merge pull request #339 from jre-g/customevent-in-aosp-browser

Define CustomEvents shim wherever it's missing, not just in IE
This commit is contained in:
John Messerly
2015-09-23 10:57:19 -07:00
2 changed files with 6 additions and 6 deletions

View File

@@ -103,9 +103,9 @@ function bootstrap() {
});
}
// CustomEvent shim for IE <= 11
// NOTE: we explicitly test for IE since Safari has a type `object` CustomEvent
if (isIE && (typeof window.CustomEvent !== 'function')) {
// CustomEvent shim
// NOTE: we can't check that typeof isn't `function` since Safari has a type `object` CustomEvent
if (!window.CustomEvent) {
window.CustomEvent = function(inType, params) {
params = params || {};
var e = document.createEvent('CustomEvent');

View File

@@ -26,9 +26,9 @@ if (scope.useNative) {
return;
}
// CustomEvent shim for IE
// NOTE: we explicitly test for IE since Safari has an type `object` CustomEvent
if (isIE && (typeof window.CustomEvent !== 'function')) {
// CustomEvent shim
// NOTE: we can't check that typeof isn't `function` since Safari has a type `object` CustomEvent
if (!window.CustomEvent) {
window.CustomEvent = function(inType, params) {
params = params || {};
var e = document.createEvent('CustomEvent');