Fixed resize-function triggering too often

This commit is contained in:
Kasper Rynning-Tønnesen
2018-10-25 11:21:52 +02:00
parent 0aa6910f25
commit c4211bcab5

View File

@@ -40,13 +40,13 @@ function resizeFunction() {
if(chan && !Helper.mobilecheck()){ if(chan && !Helper.mobilecheck()){
if(document.querySelector("#wrapper") == null) return; if(document.querySelector("#wrapper") == null) return;
if(!client && !embed) document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px"; if(!client && !embed) document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px";
if(((window.innerWidth > 600 && !embed) || (window.innerWidth > 500 && !embed)) && document.querySelector("#wrapper").style.height != "") { if(((window.innerWidth > 600 && !embed) || (window.innerWidth > 500 && embed)) && document.querySelector("#wrapper").style.height != "") {
document.querySelector("#wrapper").style.height = ""; document.querySelector("#wrapper").style.height = "";
document.querySelector("#chat-bar").style.height = ""; document.querySelector("#chat-bar").style.height = "";
document.querySelector("#channelchat").style.height = ""; document.querySelector("#channelchat").style.height = "";
document.querySelector("#all_chat").style.height = ""; document.querySelector("#all_chat").style.height = "";
document.querySelector("#chat-container").style.height = ""; document.querySelector("#chat-container").style.height = "";
} else if(((window.innerWidth < 601 && !embed) || (window.innerWidth < 501 && !embed))) { } else if(((window.innerWidth < 601 && !embed) || (window.innerWidth < 501 && embed))) {
if(!client && !embed) { if(!client && !embed) {
var scPlaying = false; var scPlaying = false;
var ytPlaying = false; var ytPlaying = false;
@@ -57,6 +57,7 @@ function resizeFunction() {
} catch(e) {} } catch(e) {}
scPlaying = !paused; scPlaying = !paused;
resizePlaylistPlaying(ytPlaying || scPlaying); resizePlaylistPlaying(ytPlaying || scPlaying);
return;
}) })
} else { } else {
try { try {