views instead modal

This commit is contained in:
JDonadio 2017-03-03 14:18:56 -03:00
commit 93168cdae6
4 changed files with 52 additions and 19 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $rootScope, $timeout, $log, $window, $ionicModal, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService, storageService, $ionicHistory, $ionicScrollDelegate, pincodeService) {
angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $rootScope, $timeout, $state, $log, $window, $ionicModal, lodash, configService, uxLanguage, platformInfo, pushNotificationsService, profileService, feeService, storageService, $ionicHistory, $ionicScrollDelegate, pincodeService) {
var updateConfig = function() {
var config = configService.getSync();
@ -53,7 +53,11 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
};
$scope.usePincodeChange = function() {
pincodeService.lockChange({
// pincodeService.lockChange({
// fromSettings: true,
// locking: $scope.usePincode.enabled
// });
$state.go('tabs.pincode', {
fromSettings: true,
locking: $scope.usePincode.enabled
});

View file

@ -1,7 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('pincodeController', function($rootScope, $timeout, $scope, $log, $window, configService) {
$scope.currentPincode = $scope.newPincode = '';
angular.module('copayApp.controllers').controller('pincodeController', function($rootScope, $state, $timeout, $scope, $log, $window, configService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.currentPincode = $scope.newPincode = '';
$scope.fromSettings = data.stateParams.fromSettings == 'true' ? true : false;
$scope.locking = data.stateParams.locking == 'true' ? true : false;
console.log('### From Settings:', $scope.fromSettings, 'Locking:', $scope.locking);
});
angular.element($window).on('keydown', function(e) {
if (e.which === 8) {
@ -87,6 +93,7 @@ angular.module('copayApp.controllers').controller('pincodeController', function(
$scope.close = function() {
$rootScope.$emit('updatePincodeOption');
$scope.pincodeModal.remove();
if ($scope.fromSettings) $state.go('tabs.advanced');
else $state.go('tabs.home');
};
});