瀏覽代碼

Allows UI.toggleFilmStrip() and UIEvents.TOGGLE_FILM_STRIP to act as setters in addition to toggles.

j8
Lyubomir Marinov 9 年之前
父節點
當前提交
c35590dbda
共有 3 個檔案被更改,包括 27 行新增2 行删除
  1. 2
    1
      modules/UI/UI.js
  2. 14
    1
      modules/UI/videolayout/FilmStrip.js
  3. 11
    0
      service/UI/UIEvents.js

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

583
  * Toggles film strip.
583
  * Toggles film strip.
584
  */
584
  */
585
 UI.toggleFilmStrip = function () {
585
 UI.toggleFilmStrip = function () {
586
-    FilmStrip.toggleFilmStrip();
586
+    var self = FilmStrip;
587
+    self.toggleFilmStrip.apply(self, arguments);
587
 };
588
 };
588
 
589
 
589
 /**
590
 /**

+ 14
- 1
modules/UI/videolayout/FilmStrip.js 查看文件

9
         this.filmStrip = $('#remoteVideos');
9
         this.filmStrip = $('#remoteVideos');
10
     },
10
     },
11
 
11
 
12
-    toggleFilmStrip () {
12
+    /**
13
+     * Toggles the visibility of the film strip.
14
+     *
15
+     * @param visible optional {Boolean} which specifies the desired visibility
16
+     * of the film strip. If not specified, the visibility will be flipped
17
+     * (i.e. toggled); otherwise, the visibility will be set to the specified
18
+     * value.
19
+     */
20
+    toggleFilmStrip (visible) {
21
+        if (typeof visible === 'boolean'
22
+                && this.isFilmStripVisible() == visible) {
23
+            return;
24
+        }
25
+
13
         this.filmStrip.toggleClass("hidden");
26
         this.filmStrip.toggleClass("hidden");
14
     },
27
     },
15
 
28
 

+ 11
- 0
service/UI/UIEvents.js 查看文件

34
     TOGGLE_CHAT: "UI.toggle_chat",
34
     TOGGLE_CHAT: "UI.toggle_chat",
35
     TOGGLE_SETTINGS: "UI.toggle_settings",
35
     TOGGLE_SETTINGS: "UI.toggle_settings",
36
     TOGGLE_CONTACT_LIST: "UI.toggle_contact_list",
36
     TOGGLE_CONTACT_LIST: "UI.toggle_contact_list",
37
+    /**
38
+     * Notifies that a command to toggle the film strip has been issued. The
39
+     * event may optionally specify a {Boolean} (primitive) value to assign to
40
+     * the visibility of the film strip (i.e. the event may act as a setter).
41
+     * The very toggling of the film strip may or may not occurred at the time
42
+     * of the receipt of the event depending on the position of the receiving
43
+     * event listener in relation to the event listener which carries out the
44
+     * command to toggle the film strip.
45
+     *
46
+     * @see {TOGGLED_FILM_STRIP}
47
+     */
37
     TOGGLE_FILM_STRIP: "UI.toggle_film_strip",
48
     TOGGLE_FILM_STRIP: "UI.toggle_film_strip",
38
     TOGGLE_SCREENSHARING: "UI.toggle_screensharing",
49
     TOGGLE_SCREENSHARING: "UI.toggle_screensharing",
39
     CONTACT_CLICKED: "UI.contact_clicked",
50
     CONTACT_CLICKED: "UI.contact_clicked",

Loading…
取消
儲存