diff --git a/src/js/controllers/buyAmazon.js b/src/js/controllers/buyAmazon.js index 48c502869..15fe08aab 100644 --- a/src/js/controllers/buyAmazon.js +++ b/src/js/controllers/buyAmazon.js @@ -1,10 +1,10 @@ 'use strict'; -angular.module('copayApp.controllers').controller('buyAmazonController', function($scope, $log, $state, $timeout, $filter, $ionicHistory, lodash, amazonService, popupService, profileService, ongoingProcess, configService, walletService, payproService, bwcError, externalLinkService, platformInfo) { +angular.module('copayApp.controllers').controller('buyAmazonController', function($scope, $log, $state, $timeout, $filter, $ionicHistory, $ionicConfig, lodash, amazonService, popupService, profileService, ongoingProcess, configService, walletService, payproService, bwcError, externalLinkService, platformInfo) { var amount; var currency; - $scope.isCordova = platformInfo.isCordova; + $scope.isCordova = platformInfo.isCordova; $scope.openExternalLink = function(url) { externalLinkService.open(url); @@ -98,6 +98,14 @@ angular.module('copayApp.controllers').controller('buyAmazonController', functio 'leading': true }); + $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) { amount = data.stateParams.amount; currency = data.stateParams.currency; diff --git a/src/js/controllers/buyCoinbase.js b/src/js/controllers/buyCoinbase.js index 8c1bd2ea9..bdd5394d1 100644 --- a/src/js/controllers/buyCoinbase.js +++ b/src/js/controllers/buyCoinbase.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('buyCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService, txFormatService) { +angular.module('copayApp.controllers').controller('buyCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, $ionicConfig, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService, txFormatService) { var amount; var currency; @@ -33,6 +33,14 @@ angular.module('copayApp.controllers').controller('buyCoinbaseController', funct } }; + $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) { $scope.isFiat = data.stateParams.currency != 'bits' && data.stateParams.currency != 'BTC' ? true : false; var parsedAmount = txFormatService.parseAmount( diff --git a/src/js/controllers/buyGlidera.js b/src/js/controllers/buyGlidera.js index 33afa5c00..46d0c3238 100644 --- a/src/js/controllers/buyGlidera.js +++ b/src/js/controllers/buyGlidera.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('buyGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, platformInfo, txFormatService) { +angular.module('copayApp.controllers').controller('buyGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, platformInfo, txFormatService) { var amount; var currency; @@ -35,6 +35,14 @@ angular.module('copayApp.controllers').controller('buyGlideraController', functi } }; + $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) { $scope.isFiat = data.stateParams.currency != 'bits' && data.stateParams.currency != 'BTC' ? true : false; var parsedAmount = txFormatService.parseAmount( diff --git a/src/js/controllers/sellCoinbase.js b/src/js/controllers/sellCoinbase.js index 9e6bf2cd8..c6fd31f58 100644 --- a/src/js/controllers/sellCoinbase.js +++ b/src/js/controllers/sellCoinbase.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('sellCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService, appConfigService, configService, txFormatService) { +angular.module('copayApp.controllers').controller('sellCoinbaseController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicScrollDelegate, $ionicConfig, lodash, coinbaseService, popupService, profileService, ongoingProcess, walletService, appConfigService, configService, txFormatService) { var amount; var currency; @@ -116,6 +116,14 @@ angular.module('copayApp.controllers').controller('sellCoinbaseController', func } }; + $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) { $scope.isFiat = data.stateParams.currency != 'bits' && data.stateParams.currency != 'BTC' ? true : false; var parsedAmount = txFormatService.parseAmount( diff --git a/src/js/controllers/sellGlidera.js b/src/js/controllers/sellGlidera.js index 119dac2fa..90a6ed027 100644 --- a/src/js/controllers/sellGlidera.js +++ b/src/js/controllers/sellGlidera.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('sellGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, txFormatService) { +angular.module('copayApp.controllers').controller('sellGlideraController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, lodash, glideraService, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, txFormatService) { var amount; var currency; @@ -35,6 +35,14 @@ angular.module('copayApp.controllers').controller('sellGlideraController', funct } }; + $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) { $scope.isFiat = data.stateParams.currency != 'bits' && data.stateParams.currency != 'BTC' ? true : false; var parsedAmount = txFormatService.parseAmount( diff --git a/src/js/controllers/topup.js b/src/js/controllers/topup.js index a5855e63a..ef536706e 100644 --- a/src/js/controllers/topup.js +++ b/src/js/controllers/topup.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('topUpController', function($scope, $log, $state, $timeout, $ionicHistory, lodash, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, bitpayService, bitpayCardService, payproService, bwcError, txFormatService, sendMaxService) { +angular.module('copayApp.controllers').controller('topUpController', function($scope, $log, $state, $timeout, $ionicHistory, $ionicConfig, lodash, popupService, profileService, ongoingProcess, walletService, configService, platformInfo, bitpayService, bitpayCardService, payproService, bwcError, txFormatService, sendMaxService) { var amount; var currency; @@ -9,6 +9,14 @@ angular.module('copayApp.controllers').controller('topUpController', function($s $scope.isCordova = platformInfo.isCordova; + $scope.$on("$ionicView.beforeLeave", function(event, data) { + $ionicConfig.views.swipeBackEnabled(true); + }); + + $scope.$on("$ionicView.enter", function(event, data) { + $ionicConfig.views.swipeBackEnabled(false); + }); + var showErrorAndBack = function(title, msg) { title = title || 'Error'; $scope.sendStatus = '';