resize #videospace on window resize

This commit is contained in:
isymchych 2016-01-20 16:26:39 +02:00
parent 27d509332a
commit cff44286f5
1 changed files with 16 additions and 20 deletions

View File

@ -427,12 +427,12 @@ var VideoLayout = {
* Resizes the large video container. * Resizes the large video container.
*/ */
resizeLargeVideoContainer (isSideBarVisible) { resizeLargeVideoContainer (isSideBarVisible) {
let animate = false;
if (largeVideo) { if (largeVideo) {
largeVideo.updateContainerSize(isSideBarVisible); largeVideo.updateContainerSize(isSideBarVisible);
largeVideo.resize(false); largeVideo.resize(animate);
} else {
this.resizeVideoSpace(false, isSideBarVisible);
} }
this.resizeVideoSpace(animate, isSideBarVisible);
this.resizeThumbnails(false); this.resizeThumbnails(false);
}, },
@ -880,26 +880,22 @@ var VideoLayout = {
* is resized. * is resized.
*/ */
resizeVideoSpace (animate, isChatVisible, completeFunction) { resizeVideoSpace (animate, isChatVisible, completeFunction) {
var availableHeight = window.innerHeight; let availableHeight = window.innerHeight;
var availableWidth = UIUtil.getAvailableVideoWidth(isChatVisible); let availableWidth = UIUtil.getAvailableVideoWidth(isChatVisible);
if (availableWidth < 0 || availableHeight < 0) return; if (availableWidth < 0 || availableHeight < 0) {
return;
if(animate) {
$('#videospace').animate({
right: window.innerWidth - availableWidth,
width: availableWidth,
height: availableHeight
},
{
queue: false,
duration: 500,
complete: completeFunction
});
} else {
$('#videospace').width(availableWidth).height(availableHeight);
} }
$('#videospace').animate({
right: window.innerWidth - availableWidth,
width: availableWidth,
height: availableHeight
}, {
queue: false,
duration: animate ? 500 : 1,
complete: completeFunction
});
}, },
getSmallVideo (id) { getSmallVideo (id) {