summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2019-02-21 18:29:15 +0100
committerache <ache@ache.one>2019-02-21 18:29:15 +0100
commit98b2b1bb4abbc7b650f9b9edd43c91e90f9880b5 (patch)
tree2c6b751fa89305e50d7af49354d969fa1f0102b7
parentConfig package (diff)
delete in the HMI
-rw-r--r--dir.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/dir.html b/dir.html
index 7b3e3ed..feff38b 100644
--- a/dir.html
+++ b/dir.html
@@ -82,7 +82,7 @@ const onSelectFile = () => {
}
};
-const deleteMethode = url => {
+const deleteMethode = (url, th) => {
fetch( url , {
method: 'DELETE',
}).then(
@@ -91,6 +91,7 @@ const deleteMethode = url => {
}
).then(
success => {
+ if( th ) th.parentNode.removeChild(th)
console.log(success);
}
).catch(
@@ -112,7 +113,7 @@ const onPageLoad = () => {
a.onclick = () => false;
td.appendChild(a);
a.addEventListener('click', () => {
- deleteMethode('/' + e.href.split('/').slice(3).join('/'))
+ deleteMethode('/' + e.href.split('/').slice(3).join('/'), e.parentNode.parentNode)
return false;
}, false);
e.parentNode.parentNode.appendChild(td);