mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
update common.js
This commit is contained in:
parent
69d175e738
commit
092dbf46f7
@ -143,15 +143,21 @@ function deleteEvent(event) {
|
|||||||
let single = false;
|
let single = false;
|
||||||
|
|
||||||
if (!selectedItems.length) {
|
if (!selectedItems.length) {
|
||||||
selectedItems = [window.location.pathname];
|
selectedItems = ["placeholder"];
|
||||||
single = true;
|
single = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Array.from(selectedItems).forEach(id => {
|
Array.from(selectedItems).forEach(id => {
|
||||||
let request = new XMLHttpRequest(),
|
let request = new XMLHttpRequest(),
|
||||||
html = buttons.delete.changeToLoading(),
|
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;
|
url = el.dataset.url;
|
||||||
|
}
|
||||||
|
|
||||||
request.open('DELETE', toWebDavURL(url));
|
request.open('DELETE', toWebDavURL(url));
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user