diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index a0120d1da..ffeafc6a3 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -7,7 +7,14 @@ angular.module('copayApp.controllers').controller('confirmController', function( var countDown = null; var cachedSendMax = {}; $scope.isCordova = platformInfo.isCordova; - $ionicConfig.views.swipeBackEnabled(false); + + $scope.$on("$ionicView.beforeLeave", function(event, data) { + $ionicConfig.views.swipeBackEnabled(true); + }); + + $scope.$on("$ionicView.enter", function(event, data) { + $ionicConfig.views.swipeBackEnabled(false); + }); $scope.$on("$ionicView.beforeEnter", function(event, data) { diff --git a/src/js/controllers/feedback/complete.js b/src/js/controllers/feedback/complete.js index 7832393c0..8c6d9f140 100644 --- a/src/js/controllers/feedback/complete.js +++ b/src/js/controllers/feedback/complete.js @@ -46,6 +46,15 @@ angular.module('copayApp.controllers').controller('completeController', function }); }; + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + + $scope.$on("$ionicView.enter", function() { + if (!$scope.fromSettings) + $ionicConfig.views.swipeBackEnabled(false); + }); + $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null; $scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false; @@ -53,11 +62,9 @@ angular.module('copayApp.controllers').controller('completeController', function $scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false; if (!$scope.fromSettings) { - $ionicConfig.views.swipeBackEnabled(false); $ionicNavBarDelegate.showBackButton(false); } else { $ionicNavBarDelegate.showBackButton(true); - $ionicConfig.views.swipeBackEnabled(true); } storageService.getFeedbackInfo(function(error, info) { diff --git a/src/js/controllers/feedback/send.js b/src/js/controllers/feedback/send.js index 1ad539a94..7be7687ff 100644 --- a/src/js/controllers/feedback/send.js +++ b/src/js/controllers/feedback/send.js @@ -41,15 +41,20 @@ angular.module('copayApp.controllers').controller('sendController', function($sc if (goHome) $state.go('tabs.home'); }; + $scope.$on("$ionicView.beforeLeave", function(event, data) { + $ionicConfig.views.swipeBackEnabled(true); + }); + + $scope.$on("$ionicView.enter", function(event, data) { + if ($scope.score) + $ionicConfig.views.swipeBackEnabled(false); + }); + $scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.isCordova = platformInfo.isCordova; $scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null; $scope.feedback = {}; - if ($scope.score) { - $ionicConfig.views.swipeBackEnabled(false); - } - switch ($scope.score) { case 1: $scope.reaction = "Ouch!"; diff --git a/src/js/controllers/onboarding/backupRequest.js b/src/js/controllers/onboarding/backupRequest.js index ca2de91df..0aad02874 100644 --- a/src/js/controllers/onboarding/backupRequest.js +++ b/src/js/controllers/onboarding/backupRequest.js @@ -2,9 +2,16 @@ angular.module('copayApp.controllers').controller('backupRequestController', function($scope, $state, $stateParams, $ionicConfig, popupService, gettextCatalog) { - $ionicConfig.views.swipeBackEnabled(false); $scope.walletId = $stateParams.walletId; + $scope.$on("$ionicView.enter", function() { + $ionicConfig.views.swipeBackEnabled(false); + }); + + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + $scope.openPopup = function() { var title = gettextCatalog.getString('Watch out!'); diff --git a/src/js/controllers/onboarding/collectEmail.js b/src/js/controllers/onboarding/collectEmail.js index ce38b2dc4..be1cafd24 100644 --- a/src/js/controllers/onboarding/collectEmail.js +++ b/src/js/controllers/onboarding/collectEmail.js @@ -2,7 +2,14 @@ angular.module('copayApp.controllers').controller('collectEmailController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, walletService, platformInfo) { - $ionicConfig.views.swipeBackEnabled(false); + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + + $scope.$on("$ionicView.enter", function() { + $ionicConfig.views.swipeBackEnabled(false); + }); + var isCordova = platformInfo.isCordova; var isWP = platformInfo.isWP; var usePushNotifications = isCordova && !isWP; @@ -34,8 +41,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func $state.go('onboarding.backupRequest', { walletId: walletId }); - } - else if (requiresOptIn) { + } else if (requiresOptIn) { $state.go('onboarding.notifications', { walletId: walletId }); diff --git a/src/js/controllers/onboarding/disclaimer.js b/src/js/controllers/onboarding/disclaimer.js index 1f428d356..ab5c7774b 100644 --- a/src/js/controllers/onboarding/disclaimer.js +++ b/src/js/controllers/onboarding/disclaimer.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope) { +angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope) { $scope.$on("$ionicView.afterEnter", function() { startupService.ready(); @@ -11,11 +11,19 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi $scope.terms = {}; $scope.accepted = {}; $scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false; - $scope.backedUp = $stateParams.backedUp; - $scope.resume = $stateParams.resume; + $scope.backedUp = $stateParams.backedUp == 'false' ? false : true; + $scope.resume = $stateParams.resume || false; $scope.shrinkView = false; }); + $scope.$on("$ionicView.enter", function() { + if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false); + }); + + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + $scope.confirm = function() { profileService.setDisclaimerAccepted(function(err) { if (err) $log.error(err); diff --git a/src/js/controllers/onboarding/notifications.js b/src/js/controllers/onboarding/notifications.js index 0b315608f..e42d37ac1 100644 --- a/src/js/controllers/onboarding/notifications.js +++ b/src/js/controllers/onboarding/notifications.js @@ -2,7 +2,14 @@ angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, $interval) { - $ionicConfig.views.swipeBackEnabled(false); + $scope.$on("$ionicView.enter", function() { + $ionicConfig.views.swipeBackEnabled(false); + }); + + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + $scope.walletId = $stateParams.walletId; $scope.allowNotif = function() { diff --git a/src/js/controllers/onboarding/welcomeController.js b/src/js/controllers/onboarding/welcomeController.js index 0c76a18b6..3b92d5d22 100644 --- a/src/js/controllers/onboarding/welcomeController.js +++ b/src/js/controllers/onboarding/welcomeController.js @@ -2,12 +2,18 @@ angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService, startupService, storageService) { - $ionicConfig.views.swipeBackEnabled(false); - - $scope.$parent.$on("$ionicView.afterEnter", function() { + $scope.$on("$ionicView.afterEnter", function() { startupService.ready(); }); + $scope.$on("$ionicView.enter", function() { + $ionicConfig.views.swipeBackEnabled(false); + }); + + $scope.$on("$ionicView.beforeLeave", function() { + $ionicConfig.views.swipeBackEnabled(true); + }); + $scope.createProfile = function() { $log.debug('Creating profile'); profileService.createProfile(function(err) { diff --git a/src/js/routes.js b/src/js/routes.js index 9f92325fc..cfab39815 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -699,7 +699,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/welcome', views: { 'onboarding': { - templateUrl: 'views/onboarding/welcome.html' + templateUrl: 'views/onboarding/welcome.html', + controller: 'welcomeController' } } }) @@ -707,7 +708,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/tour', views: { 'onboarding': { - templateUrl: 'views/onboarding/tour.html' + templateUrl: 'views/onboarding/tour.html', + controller: 'tourController' } } }) @@ -715,7 +717,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/collectEmail/:walletId', views: { 'onboarding': { - templateUrl: 'views/onboarding/collectEmail.html' + templateUrl: 'views/onboarding/collectEmail.html', + controller: 'collectEmailController' } } }) @@ -723,7 +726,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/notifications/:walletId', views: { 'onboarding': { - templateUrl: 'views/onboarding/notifications.html' + templateUrl: 'views/onboarding/notifications.html', + controller: 'notificationsController' } } }) @@ -731,7 +735,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/backupRequest/:walletId', views: { 'onboarding': { - templateUrl: 'views/onboarding/backupRequest.html' + templateUrl: 'views/onboarding/backupRequest.html', + controller: 'backupRequestController' } } }) @@ -739,7 +744,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/backupWarning/:from/:walletId', views: { 'onboarding': { - templateUrl: 'views/backupWarning.html' + templateUrl: 'views/backupWarning.html', + controller: 'backupWarningController' } } }) @@ -765,7 +771,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr url: '/terms', views: { 'onboarding': { - templateUrl: 'views/onboarding/terms.html' + templateUrl: 'views/onboarding/terms.html', + controller: 'termsController' } } }) diff --git a/www/views/backupWarning.html b/www/views/backupWarning.html index 67848cca0..49b7bc131 100644 --- a/www/views/backupWarning.html +++ b/www/views/backupWarning.html @@ -1,4 +1,4 @@ - + - +
Quick review!
Almost done! Let's review.
@@ -37,7 +37,7 @@
-
+

I have read, understood, and agree to the Terms of Use.

diff --git a/www/views/onboarding/notifications.html b/www/views/onboarding/notifications.html index a05648f92..40a69ccad 100644 --- a/www/views/onboarding/notifications.html +++ b/www/views/onboarding/notifications.html @@ -1,5 +1,5 @@ - +
Push Notifications
Would you like to receive push notifications about payments?
diff --git a/www/views/onboarding/tour.html b/www/views/onboarding/tour.html index b7cf42466..0fde2bfc1 100644 --- a/www/views/onboarding/tour.html +++ b/www/views/onboarding/tour.html @@ -1,4 +1,4 @@ - +