Handle back-button on Android devices

This commit is contained in:
Gustavo Maximiliano Cortez 2015-09-30 14:14:15 -03:00
commit 9d816c20f5
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
3 changed files with 60 additions and 10 deletions

View file

@ -44,11 +44,13 @@ angular.element(document).ready(function() {
// Back button event
document.addEventListener('backbutton', function() {
var loc = window.location;
if (loc.toString().match(/index\.html#\/$/)) {
navigator.app.exitApp();
} else {
window.location = '#/cordova/walletHome';
var isHome = loc.toString().match(/index\.html#\/$/) ? 'true' : '';
if (!window.ignoreMobilePause) {
window.location = '#/cordova/backbutton/'+isHome;
}
setTimeout(function() {
window.ignoreMobilePause = false;
}, 100);
}, false);
document.addEventListener('menubutton', function() {
@ -68,7 +70,6 @@ angular.element(document).ready(function() {
startAngular();
}, false);
} else {
try {
window.handleOpenURL = handleBitcoinURI;
window.plugins.webintent.getUri(handleBitcoinURI);