Fixed issue with too many/too few playlist-elements being shown on window-resize

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-06 16:19:35 +02:00
parent ddbd2a6381
commit 058b235eb7
2 changed files with 8 additions and 1 deletions

View File

@@ -507,6 +507,7 @@ function enable_host_mode(enabled) {
Helper.css("#fullscreen", "display", "block");
hostMode = false;
}
List.dynamicContentPageJumpTo(1);
}
function get_list_listener(){

View File

@@ -1295,9 +1295,15 @@ window.addEventListener("resize", function(){
List.dynamicContentPage(-10);
}
if(List.can_fit < temp_fit){
Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit - 1], "display", "inline-flex");
for(var i = 0; i < List.page + temp_fit; i++) {
Helper.css(document.querySelector("#wrapper").children[i], "display", "inline-flex");
}
} else if(List.can_fit > temp_fit){
Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit], "display", "none");
var elements = document.querySelector("#wrapper").children;
for(var i = List.page + temp_fit; i < elements.length; i++) {
Helper.css(document.querySelector("#wrapper").children[i], "display", "none");
}
}
List.can_fit = temp_fit;
List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3;