client: Fix chat window disappear on mobile
The chat window appears when #show-chat is clicked. That click leads to #left becoming visible, which contains chat elements. However when mobile user taps #input, on-screen keyboard appears, which triggers screen resize -> setViewportHeight() and the latter calls showVideo() which hides the chat completely. -> Fix that by doing showVideo() in setViewportHeight() only if we were not in chat mode.
This commit is contained in:
committed by
Juliusz Chroboczek
parent
888aa9bcd1
commit
499b750508
@@ -533,7 +533,9 @@ function setViewportHeight() {
|
||||
document.documentElement.style.setProperty(
|
||||
'--vh', `${window.innerHeight/100}px`,
|
||||
);
|
||||
if (!getVisibility('left')) {
|
||||
showVideo();
|
||||
}
|
||||
// Ajust video component size
|
||||
resizePeers();
|
||||
}
|
||||
@@ -577,6 +579,16 @@ function setVisibility(id, visible) {
|
||||
elt.classList.add('invisible');
|
||||
}
|
||||
|
||||
/**
|
||||
* getVisibility tells whether specified element is visible.
|
||||
*
|
||||
* @param {string} id
|
||||
*/
|
||||
function getVisibility(id) {
|
||||
let elt = document.getElementById(id);
|
||||
return !elt.classList.contains('invisible');
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows and hides various UI elements depending on the protocol state.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user