diff --git a/js/gui.js b/js/gui.js index e7d118a..a0999c5 100755 --- a/js/gui.js +++ b/js/gui.js @@ -44,6 +44,19 @@ function showalbum(uri) { switchContent('albums', uri); return false; } + +function resetSong() { + pauseTimer(); + setPlayState(false); + setPosition(0); + data = new Object; + data["name"] = ''; + data["artists"] = ''; + data["length"] = 0; + data["uri"] = ''; + setSongInfo(data); +} + function setSongInfo(data) { console.log(data); $("#infoname").html(data["name"]); @@ -60,7 +73,7 @@ function setSongInfo(data) { $('#currenttable tr .name').each( function() { - console.log(this.className); + //console.log(this.className); this.className = "name"; if(this.id == data["uri"]) { this.className += ' currenttrack'; @@ -264,16 +277,6 @@ function setPosition(pos) { $("#songelapsed").html(timeFromSeconds(currentposition / 1000)); } -function resetSong() { - pauseTimer(); - setPlayState(false); - setPosition(0); - $("#infoname").html(''); - $("#trackslider").attr("max", ''); - $("#infoartist").html(''); - $("#songlength").html('0:00'); -} - //update everything as if reloaded function updateStatusOfAll() { mopidy.playback.getCurrentTrack().then(currentTrackResults, console.error);