chore(platform): move exitApp within deviceready

This commit is contained in:
Adam Bradley
2016-04-21 22:08:11 -05:00
parent 532096b7ab
commit 95ee2bb448

View File

@ -175,7 +175,7 @@ Platform.register({
doc.addEventListener('deviceready', function() { doc.addEventListener('deviceready', function() {
// 3) cordova deviceready event triggered // 3) cordova deviceready event triggered
// add cordova listeners to fire platform events // add cordova listeners to emit platform events
doc.addEventListener('backbutton', function() { doc.addEventListener('backbutton', function() {
p.backButton.emit(null); p.backButton.emit(null);
}); });
@ -186,17 +186,17 @@ Platform.register({
p.resume.emit(null); p.resume.emit(null);
}); });
// cordova has its own exitApp method
p.exitApp = function() {
win.navigator.app.exitApp();
};
// cordova has fully loaded and we've added listeners // cordova has fully loaded and we've added listeners
p.triggerReady(); p.triggerReady();
}); });
}); });
}; };
// cordova has its own exitApp method
p.exitApp = function() {
win.navigator.app.exitApp();
};
}, },
isMatch(): boolean { isMatch(): boolean {
return !!(win.cordova || win.PhoneGap || win.phonegap); return !!(win.cordova || win.PhoneGap || win.phonegap);