Add confirmation dialog to delete options

this is only a temporary solution but it will probably safe some users from deleting their data by accident

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2018-02-28 10:01:39 +01:00
parent 5d3f952d92
commit 19a3466b18
3 changed files with 29 additions and 3 deletions

View File

@@ -169,8 +169,14 @@ app.controller('BoardController', function ($rootScope, $scope, $stateParams, St
};
$scope.cardDelete = function (card) {
CardService.delete(card.id);
StackService.removeCard(card);
OC.dialogs.confirm(t('deck', 'Are you sure you want to delete this card with all of its data?'), t('deck', 'Delete'), function(state) {
if (!state) {
return;
}
CardService.delete(card.id).then(function () {
StackService.removeCard(card);
});
});
};
$scope.cardArchive = function (card) {
CardService.archive(card);