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

      duration = duration || _calculateCollapseDuration( _contentHeight );

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