Skip to content

Commit 191464c

Browse files
author
Adam Bradley
committed
fix(CustomEvent): fix IE CustomEvent polyfill
#1131 #1231 #861
1 parent 46586a4 commit 191464c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Diff for: js/utils/events.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
(function(ionic) {
1414

1515
// Custom event polyfill
16-
ionic.CustomEvent = window.CustomEvent || (function() {
17-
var CustomEvent;
18-
CustomEvent = function(event, params) {
16+
ionic.CustomEvent = (function() {
17+
if( typeof window.CustomEvent === 'function' ) return CustomEvent;
18+
19+
var customEvent = function(event, params) {
1920
var evt;
2021
params = params || {
2122
bubbles: false,
@@ -35,8 +36,8 @@
3536
}
3637
return evt;
3738
}
38-
CustomEvent.prototype = window.Event.prototype;
39-
return CustomEvent;
39+
customEvent.prototype = window.Event.prototype;
40+
return customEvent;
4041
})();
4142

4243

0 commit comments

Comments
 (0)