Skip to content

Commit a5a323d

Browse files
author
Max Lynch
committed
Fixed bad polyfill for #181
1 parent 963e0e3 commit a5a323d

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

dist/css/ionic.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@charset "UTF-8";
21
/**
32
* Copyright 2013 Drifty Co.
43
* http://drifty.com/

dist/css/themes/ionic-ios7.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@charset "UTF-8";
21
/**
32
* Nav controllers and header bar animations
43
*/

dist/js/ionic.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -219,25 +219,26 @@ window.ionic = {
219219
(function(ionic) {
220220

221221
// Custom event polyfill
222-
223222
if(!window.CustomEvent) {
224-
var CustomEvent;
225-
226-
CustomEvent = function(event, params) {
227-
var evt;
228-
params = params || {
229-
bubbles: false,
230-
cancelable: false,
231-
detail: undefined
223+
(function() {
224+
var CustomEvent;
225+
226+
CustomEvent = function(event, params) {
227+
var evt;
228+
params = params || {
229+
bubbles: false,
230+
cancelable: false,
231+
detail: undefined
232+
};
233+
evt = document.createEvent("CustomEvent");
234+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
235+
return evt;
232236
};
233-
evt = document.createEvent("CustomEvent");
234-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
235-
return evt;
236-
};
237237

238-
CustomEvent.prototype = window.Event.prototype;
238+
CustomEvent.prototype = window.Event.prototype;
239239

240-
window.CustomEvent = CustomEvent;
240+
window.CustomEvent = CustomEvent;
241+
})();
241242
}
242243

243244
ionic.EventController = {

js/utils/events.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,26 @@
1313
(function(ionic) {
1414

1515
// Custom event polyfill
16-
1716
if(!window.CustomEvent) {
18-
var CustomEvent;
19-
20-
CustomEvent = function(event, params) {
21-
var evt;
22-
params = params || {
23-
bubbles: false,
24-
cancelable: false,
25-
detail: undefined
17+
(function() {
18+
var CustomEvent;
19+
20+
CustomEvent = function(event, params) {
21+
var evt;
22+
params = params || {
23+
bubbles: false,
24+
cancelable: false,
25+
detail: undefined
26+
};
27+
evt = document.createEvent("CustomEvent");
28+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
29+
return evt;
2630
};
27-
evt = document.createEvent("CustomEvent");
28-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
29-
return evt;
30-
};
3131

32-
CustomEvent.prototype = window.Event.prototype;
32+
CustomEvent.prototype = window.Event.prototype;
3333

34-
window.CustomEvent = CustomEvent;
34+
window.CustomEvent = CustomEvent;
35+
})();
3536
}
3637

3738
ionic.EventController = {

0 commit comments

Comments
 (0)