Skip to content
Snippets Groups Projects
Commit d9e8f378 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Avoid many popup "Do you want to quit without saving"

parent 8f720ee8
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran ...@@ -90,7 +90,7 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran
$scope.$on('$ionicView.enter', $scope.enter); $scope.$on('$ionicView.enter', $scope.enter);
$scope.$on('$stateChangeStart', function (event, next, nextParams, fromState) { $scope.$on('$stateChangeStart', function (event, next, nextParams, fromState) {
if ($scope.dirty && !$scope.saving) { if (!$scope.dirty || $scope.saving || event.defaultPrevented) return;
// stop the change state action // stop the change state action
event.preventDefault(); event.preventDefault();
...@@ -132,7 +132,6 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran ...@@ -132,7 +132,6 @@ function ESViewEditProfileController($scope, $q, $timeout, $state, $focus, $tran
// Silent // Silent
}); });
} }
}
}); });
$scope.load = function(walletData) { $scope.load = function(walletData) {
......
...@@ -1053,7 +1053,7 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis ...@@ -1053,7 +1053,7 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis
}); });
$scope.$on('$stateChangeStart', function (event, next, nextParams, fromState) { $scope.$on('$stateChangeStart', function (event, next, nextParams, fromState) {
if ($scope.dirty && !$scope.saving) { if (!$scope.dirty || $scope.saving || event.defaultPrevented) return;
// stop the change state action // stop the change state action
event.preventDefault(); event.preventDefault();
...@@ -1095,7 +1095,6 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis ...@@ -1095,7 +1095,6 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis
// Silent // Silent
}); });
} }
}
}); });
$scope.load = function(id) { $scope.load = function(id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment