Wallet Settings button in Wallet Details
This commit is contained in:
parent
a54b30f6ae
commit
1615db9890
5 changed files with 26 additions and 3 deletions
|
|
@ -1,9 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesController',
|
||||
function($scope, $rootScope, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService, platformInfo, externalLinkService, gettextCatalog, $ionicNavBarDelegate) {
|
||||
function($scope, $rootScope, $state, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService, platformInfo, externalLinkService, gettextCatalog, $ionicNavBarDelegate) {
|
||||
var wallet;
|
||||
var walletId;
|
||||
var backToDetails = false;
|
||||
|
||||
$scope.hiddenBalanceChange = function() {
|
||||
var opts = {
|
||||
|
|
@ -83,6 +84,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
backToDetails = data.stateParams.backToDetails;
|
||||
wallet = profileService.getWallet(data.stateParams.walletId);
|
||||
walletId = wallet.credentials.walletId;
|
||||
$scope.wallet = wallet;
|
||||
|
|
@ -116,4 +118,15 @@ angular.module('copayApp.controllers').controller('preferencesController',
|
|||
$scope.$on("$ionicView.enter", function(event, data) {
|
||||
$ionicNavBarDelegate.showBar(true);
|
||||
});
|
||||
|
||||
$scope.goBack = function() {
|
||||
if (backToDetails) {
|
||||
$state.go('tabs.home').then(function () {
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.wallet', {'walletId': wallet.id});
|
||||
});
|
||||
} else {
|
||||
$ionicHistory.goBack();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -115,6 +115,13 @@ angular.module('copayApp.controllers').controller('walletDetailsController', fun
|
|||
});
|
||||
};
|
||||
|
||||
$scope.openSettings = function() {
|
||||
$state.go('tabs.settings').then(function () {
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.preferences', {'walletId': $scope.wallet.id, 'backToDetails': true});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.openSearchModal = function() {
|
||||
$scope.color = $scope.wallet.color;
|
||||
$scope.isSearching = true;
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
*/
|
||||
|
||||
.state('tabs.preferences', {
|
||||
url: '/preferences/:walletId',
|
||||
url: '/preferences/:walletId/:backToDetails',
|
||||
views: {
|
||||
'tab-settings@tabs': {
|
||||
controller: 'preferencesController',
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<ion-nav-title>
|
||||
{{'Wallet Settings'|translate}}
|
||||
</ion-nav-title>
|
||||
<ion-nav-back-button>
|
||||
<ion-nav-back-button ng-click="goBack()">
|
||||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
<ion-content>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
<button class="button back-button" ng-click="startSearch(); openSearchModal()" ng-if="txHistory.length > 4">
|
||||
<i class="icon ion-ios-search-strong tx-search"></i>
|
||||
</button>
|
||||
<button class="button" ng-click="openSettings();">
|
||||
<i class="icon ion-android-settings"></i>
|
||||
</button>
|
||||
</ion-nav-buttons>
|
||||
</ion-nav-bar>
|
||||
<style type="text/css">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue