瀏覽代碼

Fixes thumbnails wrap after opening chat window. Closes issue #89.

j8
yanas 11 年之前
父節點
當前提交
66a64b6b78
共有 2 個文件被更改,包括 31 次插入6 次删除
  1. 23
    2
      chat.js
  2. 8
    4
      videolayout.js

+ 23
- 2
chat.js 查看文件

@@ -115,8 +115,7 @@ var Chat = (function (my) {
115 115
             +  '</div>');
116 116
         $('#chatconversation').animate(
117 117
             { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
118
-
119
-    }
118
+    };
120 119
 
121 120
     /**
122 121
      * Sets the subject to the UI
@@ -158,6 +157,10 @@ var Chat = (function (my) {
158 157
         var horizontalIndent = videoPosition[0];
159 158
         var verticalIndent = videoPosition[1];
160 159
 
160
+        var thumbnailSize = VideoLayout.calculateThumbnailSize(videospaceWidth);
161
+        var thumbnailsWidth = thumbnailSize[0];
162
+        var thumbnailsHeight = thumbnailSize[1];
163
+
161 164
         if (chatspace.is(":visible")) {
162 165
             videospace.animate({right: chatSize[0],
163 166
                                 width: videospaceWidth,
@@ -165,6 +168,15 @@ var Chat = (function (my) {
165 168
                                 {queue: false,
166 169
                                 duration: 500});
167 170
 
171
+            $('#remoteVideos').animate({height: thumbnailsHeight},
172
+                                        {queue: false,
173
+                                        duration: 500});
174
+
175
+            $('#remoteVideos>span').animate({height: thumbnailsHeight,
176
+                                            width: thumbnailsWidth},
177
+                                            {queue: false,
178
+                                            duration: 500});
179
+
168 180
             $('#largeVideoContainer').animate({ width: videospaceWidth,
169 181
                                                 height: videospaceHeight},
170 182
                                                 {queue: false,
@@ -200,6 +212,15 @@ var Chat = (function (my) {
200 212
                                 }
201 213
                                });
202 214
 
215
+            $('#remoteVideos').animate({height: thumbnailsHeight},
216
+                    {queue: false,
217
+                    duration: 500});
218
+
219
+            $('#remoteVideos>span').animate({height: thumbnailsHeight,
220
+                        width: thumbnailsWidth},
221
+                        {queue: false,
222
+                        duration: 500});
223
+
203 224
             $('#largeVideoContainer').animate({ width: videospaceWidth,
204 225
                                                 height: videospaceHeight},
205 226
                                                 {queue: false,

+ 8
- 4
videolayout.js 查看文件

@@ -570,7 +570,9 @@ var VideoLayout = (function (my) {
570 570
      * Resizes thumbnails.
571 571
      */
572 572
     my.resizeThumbnails = function() {
573
-        var thumbnailSize = calculateThumbnailSize();
573
+        var videoSpaceWidth = $('#remoteVideos').width();
574
+
575
+        var thumbnailSize = VideoLayout.calculateThumbnailSize(videoSpaceWidth);
574 576
         var width = thumbnailSize[0];
575 577
         var height = thumbnailSize[1];
576 578
 
@@ -682,7 +684,7 @@ var VideoLayout = (function (my) {
682 684
     /**
683 685
      * Calculates the thumbnail size.
684 686
      */
685
-    var calculateThumbnailSize = function () {
687
+    my.calculateThumbnailSize = function (videoSpaceWidth) {
686 688
         // Calculate the available height, which is the inner window height minus
687 689
        // 39px for the header minus 2px for the delimiter lines on the top and
688 690
        // bottom of the large video, minus the 36px space inside the remoteVideos
@@ -691,8 +693,10 @@ var VideoLayout = (function (my) {
691 693
 
692 694
        var numvids = $('#remoteVideos>span:visible').length;
693 695
 
694
-       // Remove the 1px borders arround videos and the chat width.
695
-       var availableWinWidth = $('#remoteVideos').width() - 2 * numvids - 50;
696
+       // Remove the 3px borders arround videos and border around the remote
697
+       // videos area
698
+       var availableWinWidth = videoSpaceWidth - 2 * 3 * numvids - 50;
699
+
696 700
        var availableWidth = availableWinWidth / numvids;
697 701
        var aspectRatio = 16.0 / 9.0;
698 702
        var maxHeight = Math.min(160, availableHeight);

Loading…
取消
儲存