From 1b86ae514b5d91ecb757aaf826396f5319ccc19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Thu, 20 Sep 2018 14:15:26 +0200 Subject: [PATCH] Fixed and Closes #383 --- server/public/assets/js/functions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/public/assets/js/functions.js b/server/public/assets/js/functions.js index 0255e395..efe000ba 100644 --- a/server/public/assets/js/functions.js +++ b/server/public/assets/js/functions.js @@ -979,7 +979,11 @@ function resizePlaylistPlaying(playing) { List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3; Helper.css(".list-song", "height", List.element_height + "px"); Channel.set_title_width(); - List.dynamicContentPageJumpTo(page / canFit); + var toJumpTo = page / canFit; + if(toJumpTo > Math.floor(full_playlist.length / List.can_fit)) { + toJumpTo = Math.floor(full_playlist.length / List.can_fit); + } + List.dynamicContentPageJumpTo(toJumpTo); if(!client) { var controlsPosition = document.querySelector("#controls").offsetHeight - Helper.computedStyle("#controls", "height"); if(document.querySelectorAll("#controls").length > 0 && !Helper.mobilecheck()) {