From 45c6cd9736b0cdd4d2e69e1a6b801191e7e2ffb9 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 7 Oct 2016 16:23:08 -0300 Subject: [PATCH] ref password and andvanced options on join and export file view --- src/js/controllers/create.js | 2 -- src/js/controllers/export.js | 13 ++++++++- src/js/controllers/join.js | 29 +++++++++++++++---- www/views/join.html | 53 +++++++++++++++++++--------------- www/views/tab-export-file.html | 12 ++++---- 5 files changed, 72 insertions(+), 37 deletions(-) diff --git a/src/js/controllers/create.js b/src/js/controllers/create.js index fcfefd653..bad361d93 100644 --- a/src/js/controllers/create.js +++ b/src/js/controllers/create.js @@ -175,8 +175,6 @@ angular.module('copayApp.controllers').controller('createController', function _create(opts) { ongoingProcess.set('creatingWallet', true); $timeout(function() { - console.log(opts); - return; profileService.createWallet(opts, function(err, client) { ongoingProcess.set('creatingWallet', false); if (err) { diff --git a/src/js/controllers/export.js b/src/js/controllers/export.js index 4d7aed6c0..a5a90766b 100644 --- a/src/js/controllers/export.js +++ b/src/js/controllers/export.js @@ -1,9 +1,20 @@ 'use strict'; angular.module('copayApp.controllers').controller('exportController', - function($scope, $timeout, $log, $ionicHistory, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) { + function($scope, $timeout, $log, $ionicHistory, $ionicScrollDelegate, backupService, walletService, storageService, profileService, platformInfo, gettextCatalog, $state, $stateParams, popupService) { var wallet = profileService.getWallet($stateParams.walletId); + $scope.showAdvChange = function() { + $scope.showAdv = !$scope.showAdv; + $scope.resizeView(); + }; + + $scope.resizeView = function() { + $timeout(function() { + $ionicScrollDelegate.resize(); + }); + }; + var init = function() { $scope.formData = {}; $scope.isEncrypted = wallet.isPrivKeyEncrypted(); diff --git a/src/js/controllers/join.js b/src/js/controllers/join.js index 83150713a..c358b7fc9 100644 --- a/src/js/controllers/join.js +++ b/src/js/controllers/join.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('joinController', - function($scope, $rootScope, $timeout, $state, $ionicHistory, profileService, configService, storageService, applicationService, gettext, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) { + function($scope, $rootScope, $timeout, $state, $ionicHistory, $ionicScrollDelegate, profileService, configService, storageService, applicationService, gettext, gettextCatalog, lodash, ledger, trezor, platformInfo, derivationPathHelper, ongoingProcess, walletService, $log, $stateParams, popupService) { var isChromeApp = platformInfo.isChromeApp; var isDevel = platformInfo.isDevel; @@ -12,6 +12,26 @@ angular.module('copayApp.controllers').controller('joinController', $scope.derivationPath = derivationPathHelper.default; $scope.account = 1; + $scope.showAdvChange = function() { + $scope.showAdv = !$scope.showAdv; + $scope.resizeView(); + }; + + $scope.resizeView = function() { + $timeout(function() { + $ionicScrollDelegate.resize(); + }); + checkPasswordFields(); + }; + + function checkPasswordFields() { + if (!$scope.encrypt) { + $scope.passphrase = $scope.createPassphrase = $scope.passwordSaved = null; + $timeout(function() { + $scope.$apply(); + }); + } + }; this.onQrCodeScanned = function(data) { $scope.secret = data; @@ -156,11 +176,10 @@ angular.module('copayApp.controllers').controller('joinController', $state.transitionTo('tabs.copayers', { walletId: client.credentials.walletId }); - }, 100); - } - else $state.go('tabs.home') + }); + } else $state.go('tabs.home'); }); - }, 100); + }); }; updateSeedSourceSelect(); diff --git a/www/views/join.html b/www/views/join.html index f21080820..c1e559383 100644 --- a/www/views/join.html +++ b/www/views/join.html @@ -40,10 +40,12 @@ - +
+ + Show advanced options Hide advanced options -
+
@@ -69,23 +71,6 @@ -
-
- - WARNING: The password cannot be recovered. Be sure to write it down. The wallet can not be restored without the password. - -
-
- - - -
- diff --git a/www/views/tab-export-file.html b/www/views/tab-export-file.html index 31eb7d51a..552ab6d9f 100644 --- a/www/views/tab-export-file.html +++ b/www/views/tab-export-file.html @@ -18,13 +18,13 @@ - - Show advanced options - Hide advanced options - +
+ + Show advanced options + Hide advanced options + -
- + Do not include private key