goHome after close preferences or add wallet

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-24 03:22:06 -03:00
commit 17f7483ec5
4 changed files with 11 additions and 8 deletions

View file

@ -1,6 +1,6 @@
<nav ng-controller="topbarController as topbar" class="tab-bar animated fadeIn"> <nav ng-controller="topbarController as topbar" class="tab-bar animated fadeIn">
<section class="left-small"> <section class="left-small">
<a class="p10" ng-show="!goBackToState && !closeToState && !index.noFocusedWallet" <a class="p10" ng-show="!goBackToState && !closeToHome && !index.noFocusedWallet"
ng-click="index.openMenu()"><i class="fi-list size-24"></i> ng-click="index.openMenu()"><i class="fi-list size-24"></i>
</a> </a>
<a ng-show="goBackToState" <a ng-show="goBackToState"
@ -10,11 +10,11 @@
</section> </section>
<section class="right-small" ng-show="index.isComplete && !goBackToState"> <section class="right-small" ng-show="index.isComplete && !goBackToState">
<a ng-show="!closeToState" class="p10" <a ng-show="!closeToHome" class="p10"
ng-click="topbar.openScanner()"><i class="fi-camera size-24"></i></a> ng-click="topbar.openScanner()"><i class="fi-camera size-24"></i></a>
<a ng-show="closeToState" class="p10" <a ng-show="closeToHome"
ng-click="$root.go(closeToState); closeToState = null"> ng-click="topbar.goHome(); closeToHome = null">
{{'Done'|translate}} <span class="text-close">{{'Close'|translate}}</span>
</a> </a>
</section> </section>

View file

@ -124,4 +124,8 @@ angular.module('copayApp.controllers').controller('topbarController', function($
} }
}; };
this.goHome = function() {
go.walletHome();
};
}); });

View file

@ -192,7 +192,7 @@ angular
templateUrl: 'views/includes/topbar.html', templateUrl: 'views/includes/topbar.html',
controller: function($scope) { controller: function($scope) {
$scope.titleSection = 'Preferences'; $scope.titleSection = 'Preferences';
$scope.closeToState = 'walletHome'; $scope.closeToHome = true;
} }
} }
} }
@ -347,7 +347,7 @@ angular
templateUrl: 'views/includes/topbar.html', templateUrl: 'views/includes/topbar.html',
controller: function($scope) { controller: function($scope) {
$scope.titleSection = 'Add wallet'; $scope.titleSection = 'Add wallet';
$scope.goBackToState = 'walletHome'; $scope.closeToHome = true;
} }
} }
} }

View file

@ -39,7 +39,6 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
root.path = function(path, cb) { root.path = function(path, cb) {
$state.transitionTo(path) $state.transitionTo(path)
.then(function() { .then(function() {
$rootScope.$emit('Local/SetTab', path);
if (cb) return cb(); if (cb) return cb();
}); });
hideSidebars(); hideSidebars();