From 17201335e61560d4e14505967a1bc16dc04ccdce Mon Sep 17 00:00:00 2001 From: ulrich Date: Sat, 10 Apr 2021 13:38:12 +0000 Subject: [PATCH] Titel aus Abspielliste loeschen (in Arbeit) --- www/ui/js/app.js | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/www/ui/js/app.js b/www/ui/js/app.js index 87fdf6b..864f20f 100644 --- a/www/ui/js/app.js +++ b/www/ui/js/app.js @@ -231,6 +231,20 @@ }); }; + this.removeSelectedTitel = function() { + var elem = document.querySelector(".selected"); + var parentElem = elem.parentNode; + console.log("elem: " + elem.nodeName + ", parent: " + parentElem.nodeName + ", len: " + parentElem.childNodes.length); + var liElems = parentElem.getElementsByTagName(elem.nodeName); + console.log("liElems.anz: " + liElems.length); + for(var i = 0; i < liElems.length; i++) { + console.log(liElems.item(i).textContent); + if(liElems.item(i).textContent === elem.textContent) { + console.log(elem.textContent + ' hat Index ' + i); + } + } + }; + /* Unterer Einblendbereich */ this.dialog_unten_zeigen = function() { @@ -242,6 +256,8 @@ self.abspielliste_auswahl_fuellen(); self.addEvtListener('#dazu-btn', 'click', self.addSelectedTitel); self.addEvtListener('#play-btn', 'click', self.play); + // /mz/api/alist/[pl-name]/[nr] + self.addEvtListener('#weg-btn', 'click', self.removeSelectedTitel); self.media_liste(); }); }; -- Gitblit v1.9.3