patternlab/styleguide/public/styleguide/js/patternlab-viewer.js
function(panels, patternData, iframePassback, switchText) {

    // count how many panels have rendered content
    var panelContentCount = 0;
    for (var i = 0; i < panels.length; ++i) {
      if (panels[i].content !== undefined) {
        panelContentCount++;
      }
    }

    // see if the count of panels with content matches number of panels
    if (panelContentCount === Panels.count()) {
      panelsViewer.renderPanels(panels, patternData, iframePassback, switchText);
    }

  }
function(panels, patternData, iframePassback, switchText) {

    // count how many panels have rendered content
    var panelContentCount = 0;
    for (var i = 0; i < panels.length; ++i) {
      if (panels[i].content !== undefined) {
        panelContentCount++;
      }
    }

    // see if the count of panels with content matches number of panels
    if (panelContentCount === Panels.count()) {
      panelsViewer.renderPanels(panels, patternData, iframePassback, switchText);
    }

  }
function ( panels , patternData , iframePassback , switchText ) { // count how many panels have rendered content var panelContentCount = 0 ; for ( var i = 0 ; i < panels . length ; ++ i ) { if ( panels [ i ] . content !== undefined ) { panelContentCount ++ ; } } // see if the count of panels with content matches number of panels if ( panelContentCount === Panels . count ( ) ) { panelsViewer . renderPanels ( panels , patternData , iframePassback , switchText ) ; } }
Check to see if all of the panels have been collected before rendering
@param  {String}      the collected panels
@param  {String}      the data from the pattern
@param  {Boolean}     if this is going to be passed back to the styleguide
Check to see if all of the panels have been collected before rendering