Skip to content

Commit

Permalink
fix(CustomEvent): fix IE CustomEvent polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed May 7, 2014
1 parent 46586a4 commit 191464c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions js/utils/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -35,8 +36,8 @@
}
return evt;
}
CustomEvent.prototype = window.Event.prototype;
return CustomEvent;
customEvent.prototype = window.Event.prototype;
return customEvent;
})();


Expand Down

0 comments on commit 191464c

Please sign in to comment.