When in private mode, all votes are reset

This commit is contained in:
Kasper Rynning-Tønnesen
2017-01-25 19:51:31 +01:00
parent 68a70a5687
commit 885e9e15ed
4 changed files with 18 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -95,7 +95,11 @@ var List = {
}
if(list_html === undefined) list_html = $("#list-song-html").html();
full_playlist = msg;
if(offline){
for(var x = 0; x < full_playlist.length; x++){
full_playlist[x].votes = 0;
}
}
List.sortList();
$("#wrapper").empty();

View File

@@ -515,6 +515,13 @@ function change_offline(enabled){
$("#viewers").addClass("hide");
$("#offline-mode").removeClass("waves-cyan");
$("#offline-mode").addClass("cyan");
if(full_playlist != undefined){
for(var x = 0; x < full_playlist.length; x++){
full_playlist[x].votes = 0;
}
List.sortList();
List.populate_list(full_playlist);
}
} else {
if(list_html){
list_html = $("<div>" + list_html + "</div>");