
This meant that after a few tracks I couldn't see which song was playing. After digging around I found the perfect spot to put a single line of Javascript to fix this; the updateCurrentImage() function in playlist.jsp (found around line 330). New code looks like this:
- Code: Select all
function updateCurrentImage() {
for (var i = 0; i < songs.length; i++) {
var song = songs[i];
var id = i + 1;
var image = $("currentImage" + id);
if (image) {
if (song.streamUrl == currentStreamUrl) {
image.show();
window.scroll(0,(i*18));
} else {
image.hide();
}
}
}
}
The magic line is window.scroll. Depending on the size of your font you may need to adjust the number, for my setup each line was 18 pixels high. I tried to base this number on the em height provided in the CSS, but it was easier just to kludge it like this.
Also by default this won't scroll until a track has changed, which means that if you refresh the page the scrolling back to the top. I fixed this by calling updateCurrentImage() at the beginning of nowPlayingCallback function (around line 50)[/code]
I know this is pretty simple fix but was a huge help to me, and might be for others that use the default interface but have long playlists.