fix(CustomEvent): fix IE CustomEvent polyfill

#1131 #1231 #861
This commit is contained in:
Adam Bradley
2014-05-07 13:40:28 -05:00
parent 46586a45dd
commit 191464c98c

View File

@@ -13,9 +13,10 @@
(function(ionic) {
// Custom event polyfill
ionic.CustomEvent = window.CustomEvent || (function() {
var CustomEvent;
CustomEvent = function(event, params) {
ionic.CustomEvent = (function() {
if( typeof window.CustomEvent === 'function' ) return CustomEvent;
var customEvent = function(event, params) {
var evt;
params = params || {
bubbles: false,
@@ -35,8 +36,8 @@
}
return evt;
}
CustomEvent.prototype = window.Event.prototype;
return CustomEvent;
customEvent.prototype = window.Event.prototype;
return customEvent;
})();