mirror of
https://github.com/anatolykopyl/file-directory.git
synced 2026-03-26 12:54:30 +00:00
17 lines
583 B
JavaScript
17 lines
583 B
JavaScript
$(document).on('click', 'div.dropdown-menu', function (e) {
|
|
e.stopPropagation();
|
|
});
|
|
|
|
const buttons = document.querySelectorAll('.delete-button')
|
|
buttons.forEach((button) => {
|
|
button.addEventListener("click", async function(event) {
|
|
const response = await fetch("delete.php", {
|
|
method: 'POST',
|
|
headers: {
|
|
'Accept': 'application/x-www-form-urlencoded',
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
},
|
|
body: `file=${event.target.dataset.file}`
|
|
});
|
|
})
|
|
}); |