1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Delete site/folder

This commit is contained in:
Kyle Spearrin
2016-09-22 14:16:24 -04:00
parent f28b690a2a
commit 95ab611595
9 changed files with 93 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
angular
.module('bit.settings')
.controller('settingsEditFolderController', function ($scope, $stateParams, folderService, toastr, $q, $state) {
.controller('settingsEditFolderController', function ($scope, $stateParams, folderService, toastr, $q, $state, SweetAlert) {
$scope.folder = {};
var folderId = $stateParams.folderId;
@@ -28,4 +28,23 @@
});
});
};
$scope.delete = function () {
SweetAlert.swal({
title: 'Delete Folder',
text: 'Are you sure you want to delete this folder?',
showCancelButton: true,
confirmButtonText: 'Yes',
cancelButtonText: 'No'
}, function (confirmed) {
if (confirmed) {
$q.when(folderService.deleteWithServer(folderId)).then(function () {
toastr.success('Deleted folder');
$state.go('folders', {
animation: 'out-slide-down'
});
});
}
});
};
});