packages/cf-expandables/src/Expandable.js
function initialize() {
  const transition = new ExpandableTransition(
    this.ui.content
  );
  this.transition = transition.init();

  if ( this.ui.content.classList.contains( ExpandableTransition.CLASSES.EXPANDED ) ) {
    this.ui.target.classList.add( this.classes.targetExpanded );
  } else {
    this.ui.target.classList.add( this.classes.targetCollapsed );
  }

  const expandableGroup = closest( this.ui.target, '.' + this.classes.group );

  this.isAccordionGroup = expandableGroup !== null &&
    expandableGroup.classList.contains( this.classes.groupAccordion );

  if ( this.isAccordionGroup ) {
    Events.on(
      'accordionActivated',
      _accordionActivatedHandler.bind( this )
    );
  }
}
function initialize() {
  const transition = new ExpandableTransition(
    this.ui.content
  );
  this.transition = transition.init();

  if ( this.ui.content.classList.contains( ExpandableTransition.CLASSES.EXPANDED ) ) {
    this.ui.target.classList.add( this.classes.targetExpanded );
  } else {
    this.ui.target.classList.add( this.classes.targetCollapsed );
  }

  const expandableGroup = closest( this.ui.target, '.' + this.classes.group );

  this.isAccordionGroup = expandableGroup !== null &&
    expandableGroup.classList.contains( this.classes.groupAccordion );

  if ( this.isAccordionGroup ) {
    Events.on(
      'accordionActivated',
      _accordionActivatedHandler.bind( this )
    );
  }
}
function initialize ( ) { const transition = new ExpandableTransition ( this . ui . content ) ; this . transition = transition . init ( ) ; if ( this . ui . content . classList . contains ( ExpandableTransition . CLASSES . EXPANDED ) ) { this . ui . target . classList . add ( this . classes . targetExpanded ) ; } else { this . ui . target . classList . add ( this . classes . targetCollapsed ) ; } const expandableGroup = closest ( this . ui . target , '.' + this . classes . group ) ; this . isAccordionGroup = expandableGroup !== null && expandableGroup . classList . contains ( this . classes . groupAccordion ) ; if ( this . isAccordionGroup ) { Events . on ( 'accordionActivated' , _accordionActivatedHandler . bind ( this ) ) ; } }
Initialize a new expandable.
Initialize a new expandable .