Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/meet/app.js
Show First 20 Lines • Show All 1,374 Lines • ▼ Show 20 Lines | function updateLayout() { | ||||
sessionData.counterElement.innerHTML = Object.keys(connections).length + 1 | sessionData.counterElement.innerHTML = Object.keys(connections).length + 1 | ||||
} | } | ||||
if (!numOfVideos) { | if (!numOfVideos) { | ||||
subscribersContainer.style.minHeight = 'auto' | subscribersContainer.style.minHeight = 'auto' | ||||
return | return | ||||
} | } | ||||
// Note: offsetHeight/offsetWidth return rounded values, but for proper matrix | |||||
// calculations we need more precision, therefore we use getBoundingClientRect() | |||||
let allHeight = container.offsetHeight | let allHeight = container.offsetHeight | ||||
let scrollHeight = subscribersContainer.scrollHeight | let scrollHeight = subscribersContainer.scrollHeight | ||||
let containerWidth = publishersContainer.offsetWidth | let bcr = publishersContainer.getBoundingClientRect() | ||||
let containerHeight = publishersContainer.offsetHeight | let containerWidth = bcr.width | ||||
let containerHeight = bcr.height | |||||
let limit = Math.ceil(allHeight * 0.25) // max subscribers list height | let limit = Math.ceil(allHeight * 0.25) // max subscribers list height | ||||
// Fix subscribers list height | // Fix subscribers list height | ||||
if (subscribersContainer.offsetHeight <= scrollHeight) { | if (subscribersContainer.offsetHeight <= scrollHeight) { | ||||
limit = Math.min(scrollHeight, limit) | limit = Math.min(scrollHeight, limit) | ||||
subscribersContainer.style.minHeight = limit + 'px' | subscribersContainer.style.minHeight = limit + 'px' | ||||
containerHeight = allHeight - limit | containerHeight = allHeight - limit | ||||
} else { | } else { | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |