fix navigation top control

This commit is contained in:
Javier 2015-11-23 17:53:42 -03:00
parent 32a1817ccb
commit 9a806f3bab
3 changed files with 79 additions and 32 deletions

View File

@ -1,16 +1,27 @@
<div <div class="" ng-controller="backupController as wordsC">
class="topbar-container" <nav class="tab-bar">
ng-include="'views/includes/topbar.html'" <section class="left-small" ng-show="!wordsC.step1 && !wordsC.step4">
ng-init="titleSection='Backup'; closeToHome = 'true'"> <a ng-click="wordsC.goToStep();">
</div> <i class="icon-arrow-left3 icon-back"></i>
</a>
</section>
<div class="content preferences backup" ng-controller="backupController as wordsC"> <section class="middle tab-bar-section">
<h4></h4> </section>
<div class="box-notification" ng-show="wordsC.error">
<span class="text-warning"> <section class="right-small">
{{wordsC.error|translate}} <a class="p10" ng-click="$root.go(index.prevState);">
</span> <span class="text-close">X</span>
</div> </a>
</section>
</nav>
<div class="content preferences backup">
<div class="box-notification" ng-show="wordsC.error">
<span class="text-warning" translate>
{{wordsC.error}}
</span>
</div>
<!-- <!--
## STEP 1 ## STEP 1
@ -169,24 +180,33 @@
<p class="text-gray p20" translate> <p class="text-gray p20" translate>
You backed up your new wallet. You can now restore this wallet at any time You backed up your new wallet. You can now restore this wallet at any time
</p> </p>
<div class="columns text-center m20t">
<button
ng-style="{'background-color':index.backgroundColor}"
class="button round expand"
ng-click="$root.go('walletHome');"
translate>Finish
</button>
</div>
</div> </div>
<div class="row m10t m10b text-center" ng-show="wordsC.backupError"> <div class="row m10t m10b text-center" ng-show="wordsC.backupError">
<div class="circle-icon"> <div class="circle-icon">
<i class="fi-like size-48"></i> <i class="fi-dislike size-48"></i>
</div> </div>
<h5>Backup failed</h5> <h5>Backup failed</h5>
<p class="text-gray p20" translate> <p class="text-gray p20" translate>
Failed to verify backup. Please try again Failed to verify backup. Please check your information
</p> </p>
</div>
<div class="columns text-center m20t"> <div class="columns text-center m20t">
<button <button
ng-style="{'background-color':index.backgroundColor}" ng-style="{'background-color':index.backgroundColor}"
class="button round expand" class="button round expand"
ng-click="$root.go('walletHome');" ng-click="$root.go(index.prevState);"
translate>Finish translate>Try again
</button> </button>
</div>
</div> </div>
</div> </div>

View File

@ -7,15 +7,22 @@ angular.module('copayApp.controllers').controller('backupController',
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
var customWords = []; var customWords = [];
var mnemonic = null; var mnemonic = null;
self.xPrivKey = null;
self.step1 = true; function init() {
self.step2 = false; customWords = [];
self.step3 = false; mnemonic = null;
self.step4 = false; self.xPrivKey = null;
self.deleted = false; self.step1 = true;
self.credentialsEncrypted = false; self.step2 = false;
self.selectComplete = false; self.step3 = false;
self.backupError = false; self.step4 = false;
self.deleted = false;
self.credentialsEncrypted = false;
self.selectComplete = false;
self.backupError = false;
}
init();
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic) if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic)
self.deleted = true; self.deleted = true;
@ -33,6 +40,21 @@ angular.module('copayApp.controllers').controller('backupController',
return mnemonic; return mnemonic;
} }
self.goToStep = function() {
if (self.step2) {
self.goToStep1();
} else if (self.step3) {
self.goToStep2();
}
}
self.goToStep1 = function() {
init();
$timeout(function() {
$scope.$apply();
}, 1);
}
self.goToStep2 = function() { self.goToStep2 = function() {
self.step1 = false; self.step1 = false;
self.step2 = true; self.step2 = true;

View File

@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.onGoingProcess = {}; self.onGoingProcess = {};
self.historyShowLimit = 10; self.historyShowLimit = 10;
self.updatingTxHistory = {}; self.updatingTxHistory = {};
self.prevState = 'walletHome';
function strip(number) { function strip(number) {
return (parseFloat(number.toPrecision(12))); return (parseFloat(number.toPrecision(12)));
@ -729,7 +730,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
_creator = ''; _creator = '';
if (it.actions && it.actions.length > 1) { if (it.actions && it.actions.length > 1) {
for (var i = 0; i < it.actions.length; i++) { for (var i = 0; i < it.actions.length; i++) {
_copayers += it.actions[i].copayerName + ':' + it.actions[i].type + ' - '; _copayers += it.actions[i].copayerName + ':' + it.actions[i].type + ' - ';
} }
_creator = (it.creatorName && it.creatorName != 'undefined') ? it.creatorName : ''; _creator = (it.creatorName && it.creatorName != 'undefined') ? it.creatorName : '';
@ -1097,6 +1098,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
}; };
$rootScope.$on('$stateChangeSuccess', function(ev, to, toParams, from, fromParams) {
self.prevState = from.name || 'walletHome';
});
$rootScope.$on('Local/ClearHistory', function(event) { $rootScope.$on('Local/ClearHistory', function(event) {
$log.debug('The wallet transaction history has been deleted'); $log.debug('The wallet transaction history has been deleted');
self.txHistory = self.completeHistory = []; self.txHistory = self.completeHistory = [];