function overlayManagerOpen(name) {
    return new Promise(function (resolve) {
      if (!this.overlays[name]) {
        throw new Error('The overlay does not exist.');
      } else if (this.active) {
        if (this.overlays[name].canForceClose) {
          this._closeThroughCaller();
        } else if (this.active === name) {
          throw new Error('The overlay is already active.');
        } else {
          throw new Error('Another overlay is currently active.');
        }
      }
      this.active = name;
      this.overlays[this.active].element.classList.remove('hidden');
      this.overlays[this.active].container.classList.remove('hidden');

      window.addEventListener('keydown', this._keyDown);
      resolve();
    }.bind(this));
  }
/**
   * @param {string} name The name of the overlay that should be opened.
   * @returns {Promise} A promise that is resolved when the overlay has been
   *                    opened.
   */
@param {string} name The name of the overlay that should be opened.
@returns {Promise} A promise that is resolved when the overlay has been
opened.
@param { string } name The name of the overlay that should be opened . @returns { Promise } A promise that is resolved when the overlay has been opened .
function overlayManagerOpen(name) {
    return new Promise(function (resolve) {
      if (!this.overlays[name]) {
        throw new Error('The overlay does not exist.');
      } else if (this.active) {
        if (this.overlays[name].canForceClose) {
          this._closeThroughCaller();
        } else if (this.active === name) {
          throw new Error('The overlay is already active.');
        } else {
          throw new Error('Another overlay is currently active.');
        }
      }
      this.active = name;
      this.overlays[this.active].element.classList.remove('hidden');
      this.overlays[this.active].container.classList.remove('hidden');
      window.addEventListener('keydown', this._keyDown);
      resolve();
    }.bind(this));
  }
function overlayManagerOpen ( name ) { return new Promise ( function ( resolve ) { if ( ! this . overlays [ name ] ) { throw new Error ( 'The overlay does not exist.' ) ; } else if ( this . active ) { if ( this . overlays [ name ] . canForceClose ) { this . _closeThroughCaller ( ) ; } else if ( this . active === name ) { throw new Error ( 'The overlay is already active.' ) ; } else { throw new Error ( 'Another overlay is currently active.' ) ; } } this . active = name ; this . overlays [ this . active ] . element . classList . remove ( 'hidden' ) ; this . overlays [ this . active ] . container . classList . remove ( 'hidden' ) ; window . addEventListener ( 'keydown' , this . _keyDown ) ; resolve ( ) ; } . bind ( this ) ) ; }
@param {string} name The name of the overlay that should be opened.
@param { string } name The name of the overlay that should be opened .