forked from assembler-institute/filesystem-explorer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfun.js
More file actions
22 lines (16 loc) · 645 Bytes
/
fun.js
File metadata and controls
22 lines (16 loc) · 645 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const deleteFiles = document.querySelectorAll("#delete-btn");
deleteFiles.forEach(element => {
element.addEventListener("click", deleteFolder)
});
function deleteFolder(event){
const popUpDeleteConfirm = confirm("Do you want to delete this file?");
console.log(popUpDeleteConfirm);
if (popUpDeleteConfirm){
let actualFolderName = event.srcElement.getAttribute("actual-folder");
console.log(actualFolderName);
fetch("delete.php?actualFolderName=./"+actualFolderName)
.then(response=>response.json())
.then(data =>console.log(data));
}
location.reload();
}