better song reset
This commit is contained in:
parent
4630c026aa
commit
ed8871788d
25
js/gui.js
25
js/gui.js
@ -44,6 +44,19 @@ function showalbum(uri) {
|
|||||||
switchContent('albums', uri);
|
switchContent('albums', uri);
|
||||||
return false;
|
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) {
|
function setSongInfo(data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
$("#infoname").html(data["name"]);
|
$("#infoname").html(data["name"]);
|
||||||
@ -60,7 +73,7 @@ function setSongInfo(data) {
|
|||||||
|
|
||||||
$('#currenttable tr .name').each(
|
$('#currenttable tr .name').each(
|
||||||
function() {
|
function() {
|
||||||
console.log(this.className);
|
//console.log(this.className);
|
||||||
this.className = "name";
|
this.className = "name";
|
||||||
if(this.id == data["uri"]) {
|
if(this.id == data["uri"]) {
|
||||||
this.className += ' currenttrack';
|
this.className += ' currenttrack';
|
||||||
@ -264,16 +277,6 @@ function setPosition(pos) {
|
|||||||
$("#songelapsed").html(timeFromSeconds(currentposition / 1000));
|
$("#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
|
//update everything as if reloaded
|
||||||
function updateStatusOfAll() {
|
function updateStatusOfAll() {
|
||||||
mopidy.playback.getCurrentTrack().then(currentTrackResults, console.error);
|
mopidy.playback.getCurrentTrack().then(currentTrackResults, console.error);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user