summaryrefslogtreecommitdiff
path: root/static/playlist.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/playlist.js')
-rw-r--r--static/playlist.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/static/playlist.js b/static/playlist.js
index 5e41de5..38db463 100644
--- a/static/playlist.js
+++ b/static/playlist.js
@@ -4,7 +4,7 @@ function Playlist(pl, audio) {
this.current = null;
this.get = function(path) {
- var li = this.current;
+ var li = this.pl.getElementsByTagName('li')[0];
while(li) {
var a = li.getElementsByTagName('a')[0];
if(a.ml.path == path)
@@ -27,12 +27,25 @@ function Playlist(pl, audio) {
a.setAttribute('class', 'playing');
pl.current = li;
ml.play();
+
+ var nextsong = li.nextElementSibling;
+ log('nextsong: ' + nextsong);
+ if(nextsong) {
+ var nexta = nextsong.getElementsByTagName('a')[0];
+ log('nexta: ' + nexta);
+ log('next ml: ' + nexta.ml);
+ nexta.ml.recode();
+ }
+
return false;
}
log(a.click);
li.appendChild(a);
this.pl.appendChild(li);
+
+ if(this.pl.firstChild == li || (this.current && this.current.nextElementSibling == li))
+ ml.recode();
}
this.next = function() {