Handle back-button on Android devices
This commit is contained in:
parent
504a8b10dd
commit
9d816c20f5
3 changed files with 60 additions and 10 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue