Просмотр исходного кода

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

j8
Lyubomir Marinov 9 лет назад
Родитель
Сommit
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,7 +583,8 @@ UI.toggleSmileys = function () {
583 583
  * Toggles film strip.
584 584
  */
585 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,7 +9,20 @@ const FilmStrip = {
9 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 26
         this.filmStrip.toggleClass("hidden");
14 27
     },
15 28
 

+ 11
- 0
service/UI/UIEvents.js Просмотреть файл

@@ -34,6 +34,17 @@ export default {
34 34
     TOGGLE_CHAT: "UI.toggle_chat",
35 35
     TOGGLE_SETTINGS: "UI.toggle_settings",
36 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 48
     TOGGLE_FILM_STRIP: "UI.toggle_film_strip",
38 49
     TOGGLE_SCREENSHARING: "UI.toggle_screensharing",
39 50
     CONTACT_CLICKED: "UI.contact_clicked",

Загрузка…
Отмена
Сохранить