Invert conditions.
This commit is contained in:
parent
606cde59f8
commit
5811541722
@ -110,11 +110,11 @@ angular.module('accountant.accounts', [
|
|||||||
* Cancel account edition. Remove it from array if a new one.
|
* Cancel account edition. Remove it from array if a new one.
|
||||||
*/
|
*/
|
||||||
$scope.cancelEdit = function(rowform, account, $index) {
|
$scope.cancelEdit = function(rowform, account, $index) {
|
||||||
if (!account.id) {
|
if (account.id) {
|
||||||
|
rowform.$cancel();
|
||||||
|
} else {
|
||||||
// Account not saved, just remove it from array.
|
// Account not saved, just remove it from array.
|
||||||
$scope.accounts.splice($index, 1);
|
$scope.accounts.splice($index, 1);
|
||||||
} else {
|
|
||||||
rowform.$cancel();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -391,10 +391,10 @@ angular.module('accountant.operations', [
|
|||||||
* Cancel edition.
|
* Cancel edition.
|
||||||
*/
|
*/
|
||||||
$scope.cancelEdit = function(operation, rowform, $index) {
|
$scope.cancelEdit = function(operation, rowform, $index) {
|
||||||
if (!operation.id) {
|
if (operation.id) {
|
||||||
$scope.operations.splice($index, 1);
|
|
||||||
} else {
|
|
||||||
rowform.$cancel();
|
rowform.$cancel();
|
||||||
|
} else {
|
||||||
|
$scope.operations.splice($index, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -89,10 +89,10 @@ angular.module('accountant.scheduler', [
|
|||||||
* Cancel operation edition. Delete if new.
|
* Cancel operation edition. Delete if new.
|
||||||
*/
|
*/
|
||||||
$scope.cancelEdit = function(operation, rowform, $index) {
|
$scope.cancelEdit = function(operation, rowform, $index) {
|
||||||
if (!operation.id) {
|
if (operation.id) {
|
||||||
$scope.operations.splice($index, 1);
|
|
||||||
} else {
|
|
||||||
rowform.$cancel();
|
rowform.$cancel();
|
||||||
|
} else {
|
||||||
|
$scope.operations.splice($index, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user