瀏覽代碼

Fixes showToolbar in filmstrip-only mode and renames some funcs

master
yanas 8 年之前
父節點
當前提交
031f2dfeb8
共有 2 個文件被更改,包括 24 次插入22 次删除
  1. 2
    2
      modules/UI/UI.js
  2. 22
    20
      modules/UI/videolayout/FilmStrip.js

+ 2
- 2
modules/UI/UI.js 查看文件

@@ -322,8 +322,8 @@ UI.start = function () {
322 322
         SidePanels.init(eventEmitter);
323 323
     } else {
324 324
         $("body").addClass("filmstrip-only");
325
-        UIUtil.setVisible('mainToolbarContainer', false);
326
-        FilmStrip.setupFilmStripOnly();
325
+        UI.showToolbar();
326
+        FilmStrip.setFilmStripOnly();
327 327
         messageHandler.enableNotifications(false);
328 328
         JitsiPopover.enabled = false;
329 329
     }

+ 22
- 20
modules/UI/videolayout/FilmStrip.js 查看文件

@@ -20,36 +20,38 @@ const FilmStrip = {
20 20
     },
21 21
 
22 22
     /**
23
-     * Initializes the filmstrip toolbar
23
+     * Initializes the filmstrip toolbar.
24 24
      */
25 25
     _initFilmStripToolbar() {
26
-        let toolbar = this._generateFilmStripToolbar();
26
+        // Do not show the toggle button in film strip only mode.
27
+        if (interfaceConfig.filmStripOnly)
28
+            return;
29
+
30
+        let toolbarContainerHTML = this._generateToolbarHTML();
27 31
         let className = this.filmStripContainerClassName;
28 32
         let container = document.querySelector(`.${className}`);
29 33
 
30
-        UIUtil.prependChild(container, toolbar);
34
+        UIUtil.prependChild(container, toolbarContainerHTML);
31 35
 
32
-        let iconSelector = '#hideVideoToolbar i';
36
+        let iconSelector = '#toggleFilmStripButton i';
33 37
         this.toggleFilmStripIcon = document.querySelector(iconSelector);
34 38
     },
35 39
 
36 40
     /**
37
-     * Generates HTML layout for filmstrip toolbar
41
+     * Generates HTML layout for filmstrip toggle button and wrapping container.
38 42
      * @returns {HTMLElement}
39 43
      * @private
40 44
      */
41
-    _generateFilmStripToolbar() {
45
+    _generateToolbarHTML() {
42 46
         let container = document.createElement('div');
43 47
         let isVisible = this.isFilmStripVisible();
44 48
         container.className = 'filmstrip__toolbar';
45
-        if(!interfaceConfig.filmStripOnly) {
46
-            container.innerHTML = `
47
-                <button id="hideVideoToolbar">
48
-                    <i class="icon-menu-${isVisible ? 'down' : 'up'}">
49
-                    </i>
50
-                </button>
51
-            `;
52
-        }
49
+        container.innerHTML = `
50
+            <button id="toggleFilmStripButton">
51
+                <i class="icon-menu-${isVisible ? 'down' : 'up'}">
52
+                </i>
53
+            </button>
54
+        `;
53 55
 
54 56
         return container;
55 57
     },
@@ -62,7 +64,7 @@ const FilmStrip = {
62 64
         // Firing the event instead of executing toggleFilmstrip method because
63 65
         // it's important to hide the filmstrip by UI.toggleFilmstrip in order
64 66
         // to correctly resize the video area.
65
-        $('#hideVideoToolbar').on('click',
67
+        $('#toggleFilmStripButton').on('click',
66 68
             () => this.eventEmitter.emit(UIEvents.TOGGLE_FILM_STRIP));
67 69
 
68 70
         this._registerToggleFilmstripShortcut();
@@ -162,11 +164,11 @@ const FilmStrip = {
162 164
         return !this.filmStrip.hasClass('hidden');
163 165
     },
164 166
 
165
-    setupFilmStripOnly() {
166
-        this.filmStrip.css({
167
-            padding: "0px 0px 18px 0px",
168
-            right: 0
169
-        });
167
+    /**
168
+     * Adjusts styles for film-strip only mode.
169
+     */
170
+    setFilmStripOnly() {
171
+        this.filmStrip.addClass('filmstrip__videos-filmstripOnly');
170 172
     },
171 173
 
172 174
     /**

Loading…
取消
儲存