We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3f7f2ae4 authored by Mike Sheldon's avatar Mike Sheldon

Stop html5 audio player buttons from scrolling the user to the top of the page (bug #138).

parent 9d32fdd3
......@@ -123,16 +123,20 @@ function pause() {
* Seeks backwards 10 seconds in the current song
*/
function seekBack() {
var audio = document.getElementById("audio");
audio.currentTime = audio.currentTime - 10;
try {
var audio = document.getElementById("audio");
audio.currentTime = audio.currentTime - 10;
} catch (e) {}
}
/**
* Seeks forwards 10 seconds in the current song
*/
function seekForward() {
var audio = document.getElementById("audio");
audio.currentTime = audio.currentTime + 10;
try {
var audio = document.getElementById("audio");
audio.currentTime = audio.currentTime + 10;
} catch (e) {}
}
/**
......@@ -181,7 +185,7 @@ function populatePlaylist() {
} else {
playable_songs = true;
}
$("#playlist > #songs").append("<li id='song-" + i + "'><a href='#' onclick='playSong(" + i + ")'>" + playlist[i]["artist"] + " - " + playlist[i]["track"] + "</li>");
$("#playlist > #songs").append("<li id='song-" + i + "'><a href='#' onclick='playSong(" + i + "); return false;'>" + playlist[i]["artist"] + " - " + playlist[i]["track"] + "</li>");
}
$("#song-" + current_song).css({fontWeight : "bold"});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment