Hardware back button support
This commit is contained in:
parent
f8a65c4932
commit
33df5044d5
1 changed files with 7 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('preferencesController',
|
angular.module('copayApp.controllers').controller('preferencesController',
|
||||||
function($scope, $rootScope, $state, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService, platformInfo, externalLinkService, gettextCatalog, $ionicNavBarDelegate) {
|
function($scope, $rootScope, $state, $timeout, $log, $ionicHistory, $ionicPlatform, configService, profileService, fingerprintService, walletService, platformInfo, externalLinkService, gettextCatalog, $ionicNavBarDelegate) {
|
||||||
var wallet;
|
var wallet;
|
||||||
var walletId;
|
var walletId;
|
||||||
var backToDetails = false;
|
var backToDetails = false;
|
||||||
|
|
@ -121,15 +121,18 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
||||||
|
|
||||||
$scope.goBack = function() {
|
$scope.goBack = function() {
|
||||||
if (backToDetails) {
|
if (backToDetails) {
|
||||||
|
$ionicHistory.nextViewOptions({disableAnimate: true});
|
||||||
$state.go('tabs.home').then(function () {
|
$state.go('tabs.home').then(function () {
|
||||||
$ionicHistory.clearHistory();
|
$ionicHistory.clearHistory();
|
||||||
$ionicHistory.nextViewOptions({
|
|
||||||
disableAnimate: true
|
|
||||||
});
|
|
||||||
$state.go('tabs.wallet', {'walletId': wallet.id});
|
$state.go('tabs.wallet', {'walletId': wallet.id});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$ionicHistory.goBack();
|
$ionicHistory.goBack();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$ionicPlatform.registerBackButtonAction(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
$scope.goBack()
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue