Fixed bug with aspectLock which broke other UX
This commit is contained in:
parent
ee5a8d9516
commit
a20bb99af2
|
|
@ -186,8 +186,12 @@ class chatBox{
|
||||||
sizeToAspect(){
|
sizeToAspect(){
|
||||||
if(this.chatPanel.style.display != "none"){
|
if(this.chatPanel.style.display != "none"){
|
||||||
var targetVidWidth = this.client.player.getRatio() * this.chatPanel.getBoundingClientRect().height;
|
var targetVidWidth = this.client.player.getRatio() * this.chatPanel.getBoundingClientRect().height;
|
||||||
|
const targetChatWidth = window.innerWidth - targetVidWidth;
|
||||||
|
//This should be changeable in settings later on, for now it defaults to 20%
|
||||||
|
const limit = window.innerWidth * .2;
|
||||||
|
|
||||||
this.chatPanel.style.width = `${(document.body.getBoundingClientRect().width - targetVidWidth)}px`;
|
//Set width to target or 20vh depending on whether or not we've hit the width limit
|
||||||
|
this.chatPanel.style.width = targetChatWidth > limit ? `${targetChatWidth}px` : '20vh';
|
||||||
|
|
||||||
//Fix busted layout
|
//Fix busted layout
|
||||||
var pageBreak = document.body.scrollWidth - document.body.getBoundingClientRect().width;
|
var pageBreak = document.body.scrollWidth - document.body.getBoundingClientRect().width;
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ class player{
|
||||||
this.uiBar.style.display = show ? "flex" : "none";
|
this.uiBar.style.display = show ? "flex" : "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleVideo(show = this.playerDiv.style.display == "none"){
|
toggleVideo(show = !this.playerDiv.checkVisibility()){
|
||||||
if(show){
|
if(show){
|
||||||
this.playerDiv.style.display = "flex";
|
this.playerDiv.style.display = "flex";
|
||||||
this.showVideoIcon.style.display = "none";
|
this.showVideoIcon.style.display = "none";
|
||||||
|
|
@ -78,7 +78,7 @@ class player{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleCinemaMode(cinema = this.navBar.style.display == "none"){
|
toggleCinemaMode(cinema = !this.navBar.checkVisibility()){
|
||||||
if(cinema){
|
if(cinema){
|
||||||
this.navBar.style.display = "flex";
|
this.navBar.style.display = "flex";
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue