function collapse( duration ) {
    if ( _isCollapsed() || _isCollapsing() ) {
      return this;
    }

    duration = duration || _calculateCollapseDuration( _contentHeight );

    _setStateTo( COLLAPSING );
    this.dispatchEvent( 'collapseBegin', { target: _that } );
    _setMinHeight();
    _transitionHeight( _collapseComplete, duration );
    return this;
  }
/**
   * @param {number} duration
   *   The duration of the sliding animation in milliseconds.
   * @returns {Expandable} An instance.
   */
@param {number} duration
The duration of the sliding animation in milliseconds.
@returns {Expandable} An instance.
@param { number } duration The duration of the sliding animation in milliseconds . @returns { Expandable } An instance .
function collapse( duration ) {
    if ( _isCollapsed() || _isCollapsing() ) {
      return this;
    }
    duration = duration || _calculateCollapseDuration( _contentHeight );
    _setStateTo( COLLAPSING );
    this.dispatchEvent( 'collapseBegin', { target: _that } );
    _setMinHeight();
    _transitionHeight( _collapseComplete, duration );
    return this;
  }
function collapse ( duration ) { if ( _isCollapsed ( ) || _isCollapsing ( ) ) { return this ; } duration = duration || _calculateCollapseDuration ( _contentHeight ) ; _setStateTo ( COLLAPSING ) ; this . dispatchEvent ( 'collapseBegin' , { target : _that } ) ; _setMinHeight ( ) ; _transitionHeight ( _collapseComplete , duration ) ; return this ; }
@param {number} duration
   The duration of the sliding animation in milliseconds.
@param { number } duration The duration of the sliding animation in milliseconds .