mirror of
https://github.com/jech/galene.git
synced 2024-12-22 23:35:46 +01:00
fix resizing when we have only 2 videos
This commit is contained in:
parent
31deef47f5
commit
2e0b195964
1 changed files with 2 additions and 2 deletions
|
@ -1143,8 +1143,8 @@ function resizePeers() {
|
|||
let container = document.getElementById("video-container");
|
||||
// Peers div has total padding of 40px, we remove 40 on offsetHeight
|
||||
// Grid has row-gap of 5px
|
||||
let margins = (columns - 1) * 5 + 40;
|
||||
let rows = Math.ceil(count / columns);
|
||||
let margins = (rows - 1) * 5 + 40;
|
||||
|
||||
if (count <= 2 && container.offsetHeight > container.offsetWidth) {
|
||||
peers.style['grid-template-columns'] = "repeat(1, 1fr)";
|
||||
|
@ -1152,7 +1152,7 @@ function resizePeers() {
|
|||
} else {
|
||||
peers.style['grid-template-columns'] = `repeat(${columns}, 1fr)`;
|
||||
}
|
||||
if (rows === 1)
|
||||
if (count === 1)
|
||||
return;
|
||||
let max_video_height = (peers.offsetHeight - margins) / rows;
|
||||
let media_list = peers.querySelectorAll(".media");
|
||||
|
|
Loading…
Reference in a new issue