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

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