don't let position go negative in onclick progressbar

pull/3588/head
Isaac Connor 2022-09-12 16:05:53 -04:00
parent f3e04ca212
commit ea1970418e
1 changed files with 4 additions and 2 deletions

View File

@ -815,8 +815,10 @@ function updateProgressBar() {
// Handles seeking when clicking on the progress bar.
function progressBarNav() {
$j('#progressBar').click(function(e) {
var x = e.pageX - $j(this).offset().left;
var seekTime = (x / $j('#progressBar').width()) * parseFloat(eventData.Length);
let x = e.pageX - $j(this).offset().left;
if (x<0) x=0;
const seekTime = (x / $j('#progressBar').width()) * parseFloat(eventData.Length);
console.log("clicked at ", x, seekTime);
streamSeek(seekTime);
});
$j('#progressBar').mouseover(function(e) {