Merge pull request #3645 from gabrielbazan7/fix/disclaimerBackButton
fix backbutton in disclaimer page
This commit is contained in:
commit
9895e82f76
2 changed files with 11 additions and 8 deletions
|
|
@ -33,7 +33,7 @@ angular.element(document).ready(function() {
|
||||||
document.addEventListener('pause', function() {
|
document.addEventListener('pause', function() {
|
||||||
if (!window.ignoreMobilePause) {
|
if (!window.ignoreMobilePause) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.location = '#/cordova/pause//';
|
window.location = '#/cordova/pause///';
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
|
|
@ -41,7 +41,7 @@ angular.element(document).ready(function() {
|
||||||
document.addEventListener('resume', function() {
|
document.addEventListener('resume', function() {
|
||||||
if (!window.ignoreMobilePause) {
|
if (!window.ignoreMobilePause) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.location = '#/cordova/resume//';
|
window.location = '#/cordova/resume///';
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
|
|
@ -54,11 +54,10 @@ angular.element(document).ready(function() {
|
||||||
document.addEventListener('backbutton', function() {
|
document.addEventListener('backbutton', function() {
|
||||||
|
|
||||||
var loc = window.location;
|
var loc = window.location;
|
||||||
var exit = loc.toString().match(/disclaimer/) ? 'true' : '';
|
var fromDisclaimer = loc.toString().match(/disclaimer/) ? 'true' : '';
|
||||||
if (exit != 'true')
|
var fromHome = loc.toString().match(/index\.html#\/$/) ? 'true' : '';
|
||||||
var exit = loc.toString().match(/index\.html#\/$/) ? 'true' : '';
|
|
||||||
if (!window.ignoreMobilePause) {
|
if (!window.ignoreMobilePause) {
|
||||||
window.location = '#/cordova/backbutton/' + exit + '/' + secondBackButtonPress;
|
window.location = '#/cordova/backbutton/' + fromHome + '/' + fromDisclaimer + '/' + secondBackButtonPress;
|
||||||
if (secondBackButtonPress == 'true') {
|
if (secondBackButtonPress == 'true') {
|
||||||
clearInterval(intval);
|
clearInterval(intval);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ angular
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.state('cordova', {
|
.state('cordova', {
|
||||||
url: '/cordova/:status/:exit/:secondBackButtonPress',
|
url: '/cordova/:status/:fromHome/:fromDisclaimer/:secondBackButtonPress',
|
||||||
views: {
|
views: {
|
||||||
'main': {
|
'main': {
|
||||||
controller: function($rootScope, $state, $stateParams, $timeout, go, isCordova) {
|
controller: function($rootScope, $state, $stateParams, $timeout, go, isCordova) {
|
||||||
|
|
@ -485,7 +485,11 @@ angular
|
||||||
$rootScope.$emit('Local/Resume');
|
$rootScope.$emit('Local/Resume');
|
||||||
break;
|
break;
|
||||||
case 'backbutton':
|
case 'backbutton':
|
||||||
if (isCordova && $stateParams.exit == 'true' && !$rootScope.modalOpened) {
|
|
||||||
|
if ($stateParams.fromDisclaimer == 'true')
|
||||||
|
navigator.app.exitApp();
|
||||||
|
|
||||||
|
if (isCordova && $stateParams.fromHome == 'true' && !$rootScope.modalOpened) {
|
||||||
if ($stateParams.secondBackButtonPress == 'true') {
|
if ($stateParams.secondBackButtonPress == 'true') {
|
||||||
navigator.app.exitApp();
|
navigator.app.exitApp();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue