Skip to content

Commit

Permalink
Chore: Settings.js - Declare class properties at class-level (#134)
Browse files Browse the repository at this point in the history
This makes class properties more explicit
  • Loading branch information
bhh1988 authored May 23, 2017
1 parent 561cb73 commit 2cacedd
Showing 1 changed file with 55 additions and 4 deletions.
59 changes: 55 additions & 4 deletions src/lib/viewers/media/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,61 @@ const SUBTITLES_SUBITEM_TEMPLATE = `<div class="bp-media-settings-sub-item" data

@autobind
class Settings extends EventEmitter {
/**
* The container of the settings element
*
* @property {HTMLElement}
*/
containerEl;

/**
* The settings element
*
* @property {HTMLElement}
*/
settingsEl;

/**
* The first item in the main menu
*
* @property {HTMLElement}
*/
firstMenuItem;

/**
* The settings button element (gear icon that opens up the menu)
*
* @property {HTMLElement}
*/
settingsButtonEl;

/**
* Whether the settings menu is visible or hiding
*
* @property {boolean}
*/
visible = false;

/**
* List of subtitles in the menu. The subtitles menu will be populated in this order
*
* @property {array}
*/
subtitles = [];

/**
* Default language to use for choosing subtitle to toggle on
*
* @property {string}
*/
language = undefined;

/**
* An index (an integer >= 0) into the subtitles list, that should be toggled to when CC toggled on
*
* @property {string}
*/
toggleToSubtitle = undefined;

/**
* Service to handle the position and movement of a slider element
Expand All @@ -125,11 +180,7 @@ class Settings extends EventEmitter {
this.settingsButtonEl = this.containerEl.querySelector('.bp-media-gear-icon');

addActivationListener(this.settingsEl, this.menuEventHandler);
this.visible = false;
this.containerEl.classList.add(CLASS_SETTINGS_SUBTITLES_UNAVAILABLE);
this.subtitles = [];
this.language = undefined;
this.toggleToSubtitle = undefined; // An index into the subtitles list. Initialize with sentinel value
this.init();
}

Expand Down

0 comments on commit 2cacedd

Please sign in to comment.