ソースを参照

Fix thumbnail overflow

j8
Ilya Daynatovich 8年前
コミット
d3df082e3d
3個のファイルの変更31行の追加7行の削除
  1. 1
    0
      css/_filmstrip.scss
  2. 1
    3
      modules/UI/util/UIUtil.js
  3. 29
    4
      modules/UI/videolayout/FilmStrip.js

+ 1
- 0
css/_filmstrip.scss ファイルの表示

@@ -50,6 +50,7 @@
50 50
         position:relative;
51 51
         height:196px;
52 52
         padding: 0;
53
+        padding-left: 17px;
53 54
         bottom: 0;
54 55
         width:auto;
55 56
         border: 2px solid transparent;

+ 1
- 3
modules/UI/util/UIUtil.js ファイルの表示

@@ -27,9 +27,7 @@ const TOOLTIP_POSITIONS = {
27 27
      * Returns the available video width.
28 28
      */
29 29
     getAvailableVideoWidth: function () {
30
-        let rightPanelWidth = 0;
31
-
32
-        return window.innerWidth - rightPanelWidth;
30
+        return window.innerWidth;
33 31
     },
34 32
 
35 33
     /**

+ 29
- 4
modules/UI/videolayout/FilmStrip.js ファイルの表示

@@ -12,6 +12,7 @@ const FilmStrip = {
12 12
     init (eventEmitter) {
13 13
         this.iconMenuDownClassName = 'icon-menu-down';
14 14
         this.iconMenuUpClassName = 'icon-menu-up';
15
+        this.filmStripContainerClassName = 'filmstrip';
15 16
         this.filmStrip = $('#remoteVideos');
16 17
         this.eventEmitter = eventEmitter;
17 18
         this._initFilmStripToolbar();
@@ -23,7 +24,8 @@ const FilmStrip = {
23 24
      */
24 25
     _initFilmStripToolbar() {
25 26
         let toolbar = this._generateFilmStripToolbar();
26
-        let container = document.querySelector('.filmstrip');
27
+        let className = this.filmStripContainerClassName;
28
+        let container = document.querySelector(`.${className}`);
27 29
 
28 30
         UIUtil.prependChild(container, toolbar);
29 31
 
@@ -203,6 +205,7 @@ const FilmStrip = {
203 205
          */
204 206
         let videoAreaAvailableWidth
205 207
             = UIUtil.getAvailableVideoWidth()
208
+            - this.getFilmstripPanelsWidth()
206 209
             - UIUtil.parseCssInt(this.filmStrip.css('right'), 10)
207 210
             - UIUtil.parseCssInt(this.filmStrip.css('paddingLeft'), 10)
208 211
             - UIUtil.parseCssInt(this.filmStrip.css('paddingRight'), 10)
@@ -265,12 +268,32 @@ const FilmStrip = {
265 268
     },
266 269
 
267 270
     /**
268
-     * Calculate the thumbnail size in order to fit all the thumnails in passed
271
+     *
272
+     * Calculates width of all panels inside filmstrip
273
+     * @returns {number} width
274
+     */
275
+    getFilmstripPanelsWidth() {
276
+        let filmstripPanelsWidth = 0;
277
+        let className = this.filmStripContainerClassName;
278
+        $(`.${className}`)
279
+            .children()
280
+            .each(function () {
281
+                if (this.id !== 'remoteVideos') {
282
+                    filmstripPanelsWidth += $(this).outerWidth();
283
+                }
284
+            });
285
+
286
+        return filmstripPanelsWidth;
287
+    },
288
+
289
+    /**
290
+     Calculate the thumbnail size in order to fit all the thumnails in passed
269 291
      * dimensions.
270 292
      * NOTE: Here we assume that the remote and local thumbnails are with the
271 293
      * same height.
272 294
      * @param {int} availableWidth the maximum width for all thumbnails
273 295
      * @param {int} availableHeight the maximum height for all thumbnails
296
+     * @returns {{localVideo, remoteVideo}}
274 297
      */
275 298
     calculateThumbnailSizeFromAvailable(availableWidth, availableHeight) {
276 299
         /**
@@ -317,10 +340,12 @@ const FilmStrip = {
317 340
             (remoteLocalWidthRatio * numberRemoteThumbs + 1), availableHeight *
318 341
             interfaceConfig.LOCAL_THUMBNAIL_RATIO);
319 342
         const h = lW / interfaceConfig.LOCAL_THUMBNAIL_RATIO;
320
-        return { localVideo:{
343
+        return {
344
+                    localVideo:{
321 345
                         thumbWidth: lW,
322 346
                         thumbHeight: h
323
-                    }, remoteVideo: {
347
+                    },
348
+                    remoteVideo: {
324 349
                         thumbWidth: lW * remoteLocalWidthRatio,
325 350
                         thumbHeight: h
326 351
                     }

読み込み中…
キャンセル
保存