From cc93366b9c8ffd113dc7383ffde47505faa84ed0 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Thu, 2 Jun 2016 12:26:54 -0500 Subject: [PATCH] fix(platform): pass original event in EventEmitter --- src/platform/platform.ts | 10 ++++------ src/platform/registry.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/platform/platform.ts b/src/platform/platform.ts index cfe208e73e8..7e58a35f311 100644 --- a/src/platform/platform.ts +++ b/src/platform/platform.ts @@ -302,9 +302,7 @@ export class Platform { // called by engines (the browser)that do not provide them /** - * The `exitApp` method is useful when running from a native platform, - * such as Cordova. This adds the ability to place the Cordova app - * in the background. + * @private */ exitApp() {} @@ -321,7 +319,7 @@ export class Platform { * app's back button within the navbar is clicked, but this event is only * referencing the platform's hardward back button. */ - backButton: EventEmitter = new EventEmitter(); + backButton: EventEmitter = new EventEmitter(); /** * The pause event emits when the native platform puts the application @@ -329,14 +327,14 @@ export class Platform { * application. This event would emit when a Cordova app is put into * the background, however, it would not fire on a standard web browser. */ - pause: EventEmitter = new EventEmitter(); + pause: EventEmitter = new EventEmitter(); /** * The resume event emits when the native platform pulls the application * out from the background. This event would emit when a Cordova app comes * out from the background, however, it would not fire on a standard web browser. */ - resume: EventEmitter = new EventEmitter(); + resume: EventEmitter = new EventEmitter(); // Getter/Setter Methods diff --git a/src/platform/registry.ts b/src/platform/registry.ts index d794b2589aa..2238ca82b69 100644 --- a/src/platform/registry.ts +++ b/src/platform/registry.ts @@ -176,14 +176,14 @@ Platform.register({ // 3) cordova deviceready event triggered // add cordova listeners to emit platform events - doc.addEventListener('backbutton', function() { - p.backButton.emit(null); + doc.addEventListener('backbutton', function(ev: Event) { + p.backButton.emit(ev); }); - doc.addEventListener('pause', function() { - p.pause.emit(null); + doc.addEventListener('pause', function(ev: Event) { + p.pause.emit(ev); }); - doc.addEventListener('resume', function() { - p.resume.emit(null); + doc.addEventListener('resume', function(ev: Event) { + p.resume.emit(ev); }); // cordova has its own exitApp method