Implement scheduled operation deletion.
This commit is contained in:
@ -86,6 +86,27 @@ accountantApp
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* Delete a scheduled operation.
|
||||
*/
|
||||
$scope.delete = function(operation, $index) {
|
||||
var id = operation.id;
|
||||
|
||||
bootbox.confirm(
|
||||
"Voulez-vous supprimer l'operation planifiée \"" + operation.label + "\" ?",
|
||||
function(result) {
|
||||
if(result) {
|
||||
operation.$delete().then(function() {
|
||||
notificationService.success("Operation #" + id + " deleted.");
|
||||
|
||||
// Remove account from array.
|
||||
$scope.operations.splice($index, 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
// Load operations on controller initialization.
|
||||
$scope.loadOperations($routeParams.accountId);
|
||||
}]);
|
||||
|
@ -124,14 +124,14 @@
|
||||
<!-- Cancel edit. -->
|
||||
<button type="button" class="btn btn-default"
|
||||
ng-if="rowform.$visible"
|
||||
ng-click="cancelEditOperation(operations, rowform)"
|
||||
ng-click="cancelEditOperation(operation, rowform)"
|
||||
title="Cancel">
|
||||
<span class="fa fa-times"></span>
|
||||
</button>
|
||||
|
||||
<!-- Remove operation. -->
|
||||
<button type="button" class="btn btn-default"
|
||||
bs-modal="static/templates/operation_remove.html"
|
||||
ng-click="delete(operation, $index)"
|
||||
title="remove">
|
||||
<span class="fa fa-trash"></span>
|
||||
</button>
|
||||
|
Reference in New Issue
Block a user