mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed error with pagination on songchange
This commit is contained in:
4
static/dist/embed.min.js
vendored
4
static/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
6
static/dist/main.min.js
vendored
6
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -46,11 +46,11 @@ var List = {
|
||||
$("#wrapper").append(add);
|
||||
},
|
||||
|
||||
insertAtIndex: function(song_info, transition) {
|
||||
insertAtIndex: function(song_info, transition, change) {
|
||||
var i = List.getIndexOfSong(song_info.id);
|
||||
var display = "none";
|
||||
if(!song_info.now_playing){
|
||||
if(i >= List.page && i < List.page + (List.can_fit-1)) display = "block"
|
||||
if(i >= List.page && i < List.page + (List.can_fit)) display = "block"
|
||||
var add = List.generateSong(song_info, transition, false, true, false, display, false);
|
||||
if(i === 0) {
|
||||
$("#wrapper").prepend(add);
|
||||
@@ -65,6 +65,9 @@ var List = {
|
||||
$($("#wrapper").children()[List.page]).css("display", "block");
|
||||
} else if($("#wrapper").children().length > List.page + List.can_fit){
|
||||
$($("#wrapper").children()[List.page + List.can_fit - 1]).css("display", "block");
|
||||
}
|
||||
if(change && List.page > 0){
|
||||
$($("#wrapper").children()[List.page - 1]).css("display", "none");
|
||||
}
|
||||
if(transition){
|
||||
setTimeout(function(){
|
||||
@@ -347,7 +350,7 @@ var List = {
|
||||
List.empty = true;
|
||||
$("#wrapper").append("<span id='empty-channel-message'>The playlist is empty.</span>");
|
||||
}
|
||||
List.insertAtIndex(full_playlist[length-1], false);
|
||||
List.insertAtIndex(full_playlist[length-1], false, true);
|
||||
/*if($("#wrapper").children().length >= List.page + List.can_fit){
|
||||
$($("#wrapper").children()[List.page + List.can_fit - 1]).css("display", "block");
|
||||
}*/
|
||||
|
||||
Reference in New Issue
Block a user