瀏覽代碼

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
             +  '</div>');
115
             +  '</div>');
116
         $('#chatconversation').animate(
116
         $('#chatconversation').animate(
117
             { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
117
             { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
118
-
119
-    }
118
+    };
120
 
119
 
121
     /**
120
     /**
122
      * Sets the subject to the UI
121
      * Sets the subject to the UI
158
         var horizontalIndent = videoPosition[0];
157
         var horizontalIndent = videoPosition[0];
159
         var verticalIndent = videoPosition[1];
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
         if (chatspace.is(":visible")) {
164
         if (chatspace.is(":visible")) {
162
             videospace.animate({right: chatSize[0],
165
             videospace.animate({right: chatSize[0],
163
                                 width: videospaceWidth,
166
                                 width: videospaceWidth,
165
                                 {queue: false,
168
                                 {queue: false,
166
                                 duration: 500});
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
             $('#largeVideoContainer').animate({ width: videospaceWidth,
180
             $('#largeVideoContainer').animate({ width: videospaceWidth,
169
                                                 height: videospaceHeight},
181
                                                 height: videospaceHeight},
170
                                                 {queue: false,
182
                                                 {queue: false,
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
             $('#largeVideoContainer').animate({ width: videospaceWidth,
224
             $('#largeVideoContainer').animate({ width: videospaceWidth,
204
                                                 height: videospaceHeight},
225
                                                 height: videospaceHeight},
205
                                                 {queue: false,
226
                                                 {queue: false,

+ 8
- 4
videolayout.js 查看文件

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

Loading…
取消
儲存