parent
c74063507d
commit
8fdfb6ee6d
|
@ -143,15 +143,21 @@ function deleteEvent(event) {
|
|||
let single = false;
|
||||
|
||||
if (!selectedItems.length) {
|
||||
selectedItems = [window.location.pathname];
|
||||
selectedItems = ["placeholder"];
|
||||
single = true;
|
||||
}
|
||||
|
||||
Array.from(selectedItems).forEach(id => {
|
||||
let request = new XMLHttpRequest(),
|
||||
html = buttons.delete.changeToLoading(),
|
||||
el = document.getElementById(id),
|
||||
el, url;
|
||||
|
||||
if (single) {
|
||||
url = window.location.pathname;
|
||||
} else {
|
||||
el = document.getElementById(id);
|
||||
url = el.dataset.url;
|
||||
}
|
||||
|
||||
request.open('DELETE', toWebDavURL(url));
|
||||
request.onreadystatechange = function() {
|
||||
|
|
Loading…
Reference in New Issue