src/components/settings-menu-button.js
/**
   * Create the settings menu
   *
   * @return {Menu} Menu object populated with items
   * @method createMenu
   */
Create the settings menu
@return {Menu} Menu object populated with items
@method createMenu
Create the settings menu @return { Menu } Menu object populated with items @method createMenu
createMenu() {
    let menu = new Menu(this.player());
    let entries = this.options_.entries;
    if (entries) {
      const openSubMenu = function() {
        if (videojs.hasClass(this.el_, 'open')) {
          videojs.removeClass(this.el_, 'open');
        } else {
          videojs.addClass(this.el_, 'open');
        }
      };
      for (let entry of entries) {
        let settingsMenuItem = new SettingsMenuItem(this.player(), this.options_, entry);
        menu.addChild(settingsMenuItem);
        settingsMenuItem.on('click', videojs.bind(this, this.hideChildren));
        settingsMenuItem.on('click', openSubMenu);
      }
    }
    return menu;
  }
createMenu ( ) { let menu = new Menu ( this . player ( ) ) ; let entries = this . options_ . entries ; if ( entries ) { const openSubMenu = function ( ) { if ( videojs . hasClass ( this . el_ , 'open' ) ) { videojs . removeClass ( this . el_ , 'open' ) ; } else { videojs . addClass ( this . el_ , 'open' ) ; } } ; for ( let entry of entries ) { let settingsMenuItem = new SettingsMenuItem ( this . player ( ) , this . options_ , entry ) ; menu . addChild ( settingsMenuItem ) ; settingsMenuItem . on ( 'click' , videojs . bind ( this , this . hideChildren ) ) ; settingsMenuItem . on ( 'click' , openSubMenu ) ; } } return menu ; }
Create the settings menu
 @return {Menu} Menu object populated with items
 @method createMenu
Create the settings menu @return { Menu } Menu object populated with items @method createMenu
// Hide children to avoid sub menus stacking on top of each other // or having multiple menus open // Wether to add or remove selected class on the settings sub menu element