adding controllers to route file, moving swipe back enable to enter event

This commit is contained in:
Gabriel Bazán 2017-03-03 10:36:19 -03:00
commit 14baa77404
15 changed files with 50 additions and 34 deletions

View file

@ -50,6 +50,11 @@ angular.module('copayApp.controllers').controller('completeController', 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;
@ -57,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) {

View file

@ -45,15 +45,16 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
$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!";