summaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
Diffstat (limited to 'static')
-rw-r--r--static/playlist.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/static/playlist.js b/static/playlist.js
index 4b818d6..a84e3d5 100644
--- a/static/playlist.js
+++ b/static/playlist.js
@@ -1,6 +1,5 @@
-function Playlist(pl, audio) {
+function Playlist(pl) {
this.pl = pl;
- this.audio = audio;
this.current = null;
this.lastalbum = null;
@@ -42,7 +41,6 @@ function Playlist(pl, audio) {
ml.play();
var nextsong = li.nextElementSibling;
- log('nextsong: ' + nextsong);
// avoid breaking when a track has been removed
while(nextsong && nextsong.childElementCount == 0)
nextsong = nextsong.nextElementSibling;
@@ -55,8 +53,8 @@ function Playlist(pl, audio) {
return false;
}
- log(a.click);
+ // album header
if(ml.metadata.album != this.lastalbum) {
var album_li = document.createElement('li');
album_li.appendChild(document.createTextNode(ml.metadata.album));
@@ -109,8 +107,6 @@ function Playlist(pl, audio) {
del_img.src = '/static/icons/delete.png';
a_del.appendChild(del_img);
a_del.onclick = function() {
- log(li.previousElementSibling);
- log(li.nextElementSibling);
// remove previous element if it is an album header and we're at end of queue,
// or next element is an album header
if(li.previousElementSibling && li.previousElementSibling.getAttribute('class') == 'album'
@@ -175,19 +171,13 @@ function Playlist(pl, audio) {
// play the next queued song
this.next = function() {
- log('next');
- log('this: ' + this);
- log('current: ' + this.current);
if(this.current) {
var old = this.current;
- log('old: ' + old);
this.current = this.current.nextElementSibling;
- log('new current: ' + this.current);
old.parentElement.removeChild(old);
}
// avoid breaking when a track has been removed
while(this.current && this.current.getAttribute('class') == 'album') {
- log('next while loop');
this.current = this.current.nextElementSibling;
}
if(this.current) {