From 092dbf46f7f403bfaef402f6e6d13634240c005c Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 30 Dec 2016 11:45:09 +0000 Subject: [PATCH] update common.js --- _embed/public/js/common.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/_embed/public/js/common.js b/_embed/public/js/common.js index 34d58cc4..e2745264 100644 --- a/_embed/public/js/common.js +++ b/_embed/public/js/common.js @@ -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() {