reactivate swipeback when leaving a view where swipeback is not enabled

This commit is contained in:
Gabriel Bazán 2017-02-23 14:26:05 -05:00
parent 9187c72fb9
commit 91b62bb884
8 changed files with 53 additions and 9 deletions

View File

@ -7,10 +7,15 @@ 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.beforeEnter", function(event, data) {
$ionicConfig.views.swipeBackEnabled(false);
toAmount = data.stateParams.toAmount;
cachedSendMax = {};
$scope.showFeeFiat = false;

View File

@ -46,6 +46,10 @@ angular.module('copayApp.controllers').controller('completeController', function
});
};
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
$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;

View File

@ -41,6 +41,10 @@ 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.beforeEnter", function(event, data) {
$scope.isCordova = platformInfo.isCordova;
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;

View File

@ -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.beforeLeave", function(event, data) {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$ionicConfig.views.swipeBackEnabled(false);
});
$scope.openPopup = function() {
var title = gettextCatalog.getString('Watch out!');

View File

@ -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.beforeEnter", 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
});

View File

@ -12,10 +12,15 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
$scope.accepted = {};
$scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false;
$scope.backedUp = $stateParams.backedUp;
$scope.resume = $stateParams.resume;
$scope.resume = $stateParams.resume || false;
if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false);
$scope.shrinkView = false;
});
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.confirm = function() {
profileService.setDisclaimerAccepted(function(err) {
if (err) $log.error(err);

View File

@ -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.beforeEnter", function() {
$ionicConfig.views.swipeBackEnabled(false);
});
$scope.$on("$ionicView.beforeLeave", function() {
$ionicConfig.views.swipeBackEnabled(true);
});
$scope.walletId = $stateParams.walletId;
$scope.allowNotif = function() {

View File

@ -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() {
startupService.ready();
});
$scope.$on("$ionicView.beforeEnter", 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) {