diff options
Diffstat (limited to 'templates/javascript_refresh.inc')
-rw-r--r-- | templates/javascript_refresh.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/javascript_refresh.inc b/templates/javascript_refresh.inc index b0c5cd8b..92694bc4 100644 --- a/templates/javascript_refresh.inc +++ b/templates/javascript_refresh.inc @@ -61,11 +61,11 @@ function countdown() { if (displaycountdown==1) { window.status="Refreshing in "+reloadseconds+" seconds"; if ((player == 'mpd') && (player_state == 'play')) { - NodeList = document.getElementById ('mpd_cur_track_pos'); + if (NodeList = document.getElementById ('mpd_cur_track_pos')) { NodeList.firstChild.data = fmt_time((mpd_elapsed) + (secondssinceloaded)); } - NodeList = document.getElementById ('mpd_on_deck_in'); + if (NodeList = document.getElementById ('mpd_on_deck_in')) { NodeList.firstChild.data = fmt_time (mpd_song_length - mpd_elapsed - secondssinceloaded); } - NodeList = document.getElementById ('mpd_pctplayed'); + if (NodeList = document.getElementById ('mpd_pctplayed')) { NodeList.firstChild.data = Math.floor (100*(mpd_elapsed + secondssinceloaded)/mpd_song_length); } } if (reloadseconds > 0) { |