Fixed scaling issues with chat and soundcloud players on resizing

This commit is contained in:
Kasper Rynning-Tønnesen
2018-06-28 16:51:31 +02:00
parent cf68d52afb
commit 6fa293aba4
4 changed files with 22 additions and 4 deletions

View File

@@ -249,7 +249,7 @@ margin: auto;
}
#chat-container, #suggestions{
height:calc(100vh - 48px - 64px) !important;
height:calc(100vh - 48px - 64px);
}
.channel-info-all-chat {
@@ -2914,7 +2914,7 @@ nav ul li:hover, nav ul li.active {
#chat-container {
height: calc(100vh - 48px - 64px - 120px) !important;
height: calc(100vh - 48px - 64px - 120px);
margin-bottom: 18px;
}

View File

@@ -784,10 +784,17 @@ function resizePlaylistPlaying(playing) {
if(window.innerWidth < 601) {
var subtract = 0;
if(playing) {
Helper.css("#chat-bar", "height", window.innerHeight - 246 - subtract + "px");
var height = window.innerHeight - 246 - 170 - subtract;
Helper.css("#chat-bar", "height", height + "px");
Helper.css("#channelchat", "height", height - 130 + "px");
Helper.css("#all_chat", "height", height - 130 + "px");
Helper.css("#chat-container", "height", height + "px");
subtract = 200;
} else {
document.querySelector("#chat-bar").style.height = "";
document.querySelector("#channelchat").style.height = "";
document.querySelector("#all_chat").style.height = "";
document.querySelector("#chat-container").style.height = "";
}
Helper.css("#wrapper", "height", window.innerHeight - 246 - subtract + "px");
var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1;

View File

@@ -1280,8 +1280,12 @@ window.addEventListener("resize", function(){
if(chan && !Helper.mobilecheck()){
if(window.innerWidth > 600 && document.querySelector("#wrapper").style.height != "") {
document.querySelector("#wrapper").style.height = "";
document.querySelector("#chat-bar").style.height = "";
document.querySelector("#channelchat").style.height = "";
document.querySelector("#all_chat").style.height = "";
document.querySelector("#chat-container").style.height = "";
} else if(window.innerWidth < 601) {
resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING);
resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || Player.soundcloud_player.isPlaying());
return;
}
var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1;

View File

@@ -626,6 +626,9 @@ var Player = {
end_programmatically = false;
} else {
was_stopped = true;
if(!embed && !client && window.location.pathname != "/") {
resizePlaylistPlaying(false);
}
if(!chromecastAvailable){
if(Helper.mobilecheck()) {
Helper.css("#playpause", "visibility", "visible");
@@ -665,6 +668,10 @@ var Player = {
//}
}
if(!embed && !client && window.location.pathname != "/") {
resizePlaylistPlaying(true);
}
Helper.css("#playpause", "visibility", "visible");
Helper.css("#playpause", "pointer-events", "all");
playing = true;