Fixed issue with hiding/showing the last video on resize

This commit is contained in:
Kasper Rynning-Tønnesen
2017-02-12 17:17:32 +01:00
parent 5ff69f557b
commit 35a428b801
6 changed files with 22 additions and 13 deletions

View File

@@ -54,6 +54,7 @@
align-items: center; align-items: center;
flex-shrink: initial; flex-shrink: initial;
justify-content: space-between; justify-content: space-between;
height: 32px;
} }
#pageButtons, #pageButtons a{ #pageButtons, #pageButtons a{
@@ -1619,7 +1620,7 @@ nav ul li:hover, nav ul li.active {
} }
.tabs_height{ .tabs_height{
height:calc(100vh - 48px - 64px - 36px) !important; height:calc(100vh - 48px - 64px - 32px) !important;
overflow:auto; overflow:auto;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -94,7 +94,7 @@ var List = {
{ {
if(!Helper.mobilecheck() && !embed){ if(!Helper.mobilecheck() && !embed){
List.can_fit = Math.round(($("#wrapper").height()) / 71)+1; List.can_fit = Math.round(($("#wrapper").height()) / 71)+1;
List.element_height = (($("#wrapper").height()) / List.can_fit)-6; List.element_height = (($("#wrapper").height()) / List.can_fit)-5.3;
} else if(embed) { } else if(embed) {
List.can_fit = Math.round(($("#wrapper").height()) / 91) + 1; List.can_fit = Math.round(($("#wrapper").height()) / 91) + 1;
List.element_height = (($("#wrapper").height()) / List.can_fit)-4; List.element_height = (($("#wrapper").height()) / List.can_fit)-4;

View File

@@ -1172,8 +1172,16 @@ $(window).resize(function(){
if(temp_fit > List.can_fit || temp_fit < List.can_fit){ if(temp_fit > List.can_fit || temp_fit < List.can_fit){
List.dynamicContentPage(-10); List.dynamicContentPage(-10);
} }
if(List.can_fit < temp_fit){
console.log("1");
$($("#wrapper").children()[List.page + temp_fit - 1]).css("display", "block");
} else if(List.can_fit > temp_fit){
console.log("2");
$($("#wrapper").children()[List.page + temp_fit]).css("display", "none");
}
List.can_fit = temp_fit; List.can_fit = temp_fit;
List.element_height = (($("#wrapper").height()) / List.can_fit)-6; List.element_height = (($("#wrapper").height()) / List.can_fit)-5.3;
console.log(List.page);
$(".list-song").css("height", List.element_height + "px"); $(".list-song").css("height", List.element_height + "px");
$("#player_overlay").width($("#player").width()+1); $("#player_overlay").width($("#player").width()+1);
set_title_width(); set_title_width();
@@ -1253,7 +1261,7 @@ $(document).on("click", "#player_bottom_overlay", function(){
Frontpage.to_channel(chan.toLowerCase(), false); Frontpage.to_channel(chan.toLowerCase(), false);
}); });
$(document).on("mousemove", "#playlist", function(e) /*$(document).on("mousemove", "#playlist", function(e)
{ {
var y = e.pageY - this.offsetTop; var y = e.pageY - this.offsetTop;
if(((y <= 80 && y >= 48)) && $("#wrapper").scrollTop() > 0){ if(((y <= 80 && y >= 48)) && $("#wrapper").scrollTop() > 0){
@@ -1279,7 +1287,7 @@ $(document).on("click", "#top-button", function(){
$(document).on("click", "#bottom-button", function(){ $(document).on("click", "#bottom-button", function(){
List.scrollBottom(); List.scrollBottom();
}); });*/
$(document).keydown(function(event) { $(document).keydown(function(event) {

View File

@@ -195,9 +195,9 @@
</div> </div>
</div> </div>
<div id="playlist" class="col s12 m3"> <div id="playlist" class="col s12 m3">
<div id="top-button" title="Scroll to the top" class="rounded-bottom hide top-button-with-tabs hide-on-small-only">Top</div> <!--<div id="top-button" title="Scroll to the top" class="rounded-bottom hide top-button-with-tabs hide-on-small-only">Top</div>
<div id="bottom-button" title="Scroll to the bottom" class="rounded-top hide hide-on-small-only">Bottom</div> <div id="bottom-button" title="Scroll to the bottom" class="rounded-top hide hide-on-small-only">Bottom</div>
<ul class="tabs playlist-tabs tabs-fixed-width" style="width:96%"> --><ul class="tabs playlist-tabs tabs-fixed-width" style="width:96%">
<li class="tab col s3"><a class="playlist-tab-links playlist-link active truncate" href="#wrapper">Playlist</a></li> <li class="tab col s3"><a class="playlist-tab-links playlist-link active truncate" href="#wrapper">Playlist</a></li>
<li class="tab col s3"><a class="playlist-tab-links chat-link truncate" href="#chat">Chat<span class="new badge white hide"></span></a></li> <li class="tab col s3"><a class="playlist-tab-links chat-link truncate" href="#chat">Chat<span class="new badge white hide"></span></a></li>
</ul> </ul>