From cff44286f5f3464b81ca3b24d09ccefa9af766b6 Mon Sep 17 00:00:00 2001 From: isymchych Date: Wed, 20 Jan 2016 16:26:39 +0200 Subject: [PATCH] resize #videospace on window resize --- modules/UI/videolayout/VideoLayout.js | 36 ++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index cb59dd58f..88152028a 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -427,12 +427,12 @@ var VideoLayout = { * Resizes the large video container. */ resizeLargeVideoContainer (isSideBarVisible) { + let animate = false; if (largeVideo) { largeVideo.updateContainerSize(isSideBarVisible); - largeVideo.resize(false); - } else { - this.resizeVideoSpace(false, isSideBarVisible); + largeVideo.resize(animate); } + this.resizeVideoSpace(animate, isSideBarVisible); this.resizeThumbnails(false); }, @@ -880,26 +880,22 @@ var VideoLayout = { * is resized. */ resizeVideoSpace (animate, isChatVisible, completeFunction) { - var availableHeight = window.innerHeight; - var availableWidth = UIUtil.getAvailableVideoWidth(isChatVisible); + let availableHeight = window.innerHeight; + let availableWidth = UIUtil.getAvailableVideoWidth(isChatVisible); - 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); + if (availableWidth < 0 || availableHeight < 0) { + return; } + $('#videospace').animate({ + right: window.innerWidth - availableWidth, + width: availableWidth, + height: availableHeight + }, { + queue: false, + duration: animate ? 500 : 1, + complete: completeFunction + }); }, getSmallVideo (id) {