Fixed chat width breaking when video hidden.
This commit is contained in:
parent
441108c9cb
commit
4c54c270d2
3 changed files with 43 additions and 8 deletions
|
|
@ -295,9 +295,14 @@ class chatBox{
|
|||
}
|
||||
|
||||
resizeAspect(event){
|
||||
if(this.aspectLock){
|
||||
const playerHidden = this.client.player.playerDiv.style.display == "none";
|
||||
|
||||
//If the aspect is locked and the player is hidden
|
||||
if(this.aspectLock && !playerHidden){
|
||||
this.sizeToAspect();
|
||||
//Otherwise
|
||||
}else{
|
||||
//Fix the clickDragger on userlist
|
||||
this.client.userList.clickDragger.fixCutoff();
|
||||
}
|
||||
}
|
||||
|
|
@ -334,4 +339,28 @@ class chatBox{
|
|||
this.client.player.hideVideoIcon.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
handleVideoToggle(show){
|
||||
//If we're enabling the video
|
||||
if(show){
|
||||
//Show hide chat icon
|
||||
this.hideChatIcon.style.display = "flex";
|
||||
|
||||
//Re-enable the click dragger
|
||||
this.clickDragger.enabled = true;
|
||||
|
||||
//Lock the chat to aspect ratio of the video, to make sure the chat width isn't breaking shit
|
||||
this.lockAspect();
|
||||
//If we're disabling the video
|
||||
}else{
|
||||
//Hide hide hide hide hide hide chat icon
|
||||
this.hideChatIcon.style.display = "none";
|
||||
|
||||
//Need to clear the width from the split, or else it doesn't display properly
|
||||
this.chatPanel.style.flexBasis = "100%";
|
||||
|
||||
//Disable the click dragger
|
||||
this.clickDragger.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -224,16 +224,13 @@ class player{
|
|||
if(show){
|
||||
this.playerDiv.style.display = "flex";
|
||||
this.showVideoIcon.style.display = "none";
|
||||
this.client.chatBox.hideChatIcon.style.display = "flex";
|
||||
//Lock the chat to aspect ratio of the video, to make sure the chat width isn't breaking shit
|
||||
this.client.chatBox.lockAspect();
|
||||
}else{
|
||||
this.playerDiv.style.display = "none";
|
||||
this.showVideoIcon.style.display = "flex";
|
||||
this.client.chatBox.hideChatIcon.style.display = "none";
|
||||
//Need to clear the width from the split, or else it doesn't display properly
|
||||
this.client.chatBox.chatPanel.style.flexBasis = "100%";
|
||||
}
|
||||
|
||||
//Tell chatbox to handle this shit
|
||||
this.client.chatBox.handleVideoToggle(show);
|
||||
}
|
||||
|
||||
toggleCinemaMode(cinema = !this.navBar.checkVisibility()){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue