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

This commit is contained in:
Lyubomir Marinov 2016-03-11 04:54:06 -06:00
parent 972fc402e4
commit c35590dbda
3 changed files with 27 additions and 2 deletions

View File

@ -583,7 +583,8 @@ UI.toggleSmileys = function () {
* Toggles film strip.
*/
UI.toggleFilmStrip = function () {
FilmStrip.toggleFilmStrip();
var self = FilmStrip;
self.toggleFilmStrip.apply(self, arguments);
};
/**

View File

@ -9,7 +9,20 @@ const FilmStrip = {
this.filmStrip = $('#remoteVideos');
},
toggleFilmStrip () {
/**
* Toggles the visibility of the film strip.
*
* @param visible optional {Boolean} which specifies the desired visibility
* of the film strip. If not specified, the visibility will be flipped
* (i.e. toggled); otherwise, the visibility will be set to the specified
* value.
*/
toggleFilmStrip (visible) {
if (typeof visible === 'boolean'
&& this.isFilmStripVisible() == visible) {
return;
}
this.filmStrip.toggleClass("hidden");
},

View File

@ -34,6 +34,17 @@ export default {
TOGGLE_CHAT: "UI.toggle_chat",
TOGGLE_SETTINGS: "UI.toggle_settings",
TOGGLE_CONTACT_LIST: "UI.toggle_contact_list",
/**
* Notifies that a command to toggle the film strip has been issued. The
* event may optionally specify a {Boolean} (primitive) value to assign to
* the visibility of the film strip (i.e. the event may act as a setter).
* The very toggling of the film strip may or may not occurred at the time
* of the receipt of the event depending on the position of the receiving
* event listener in relation to the event listener which carries out the
* command to toggle the film strip.
*
* @see {TOGGLED_FILM_STRIP}
*/
TOGGLE_FILM_STRIP: "UI.toggle_film_strip",
TOGGLE_SCREENSHARING: "UI.toggle_screensharing",
CONTACT_CLICKED: "UI.contact_clicked",