patternlab/styleguide/public/styleguide/js/patternlab-viewer.js
function(templateRendered, patternPartial) {
    
    var els = templateRendered.querySelectorAll('#sg-'+patternPartial+'-tabs li');
    for (var i = 0; i < els.length; ++i) {
      els[i].onclick = function(e) {
        e.preventDefault();
        var patternPartial = this.getAttribute('data-patternpartial');
        var panelID = this.getAttribute('data-panelid');
        panelsUtil.show(patternPartial, panelID);
      };
    }
    
    return templateRendered;
    
  }
function(templateRendered, patternPartial) {
    
    var els = templateRendered.querySelectorAll('#sg-'+patternPartial+'-tabs li');
    for (var i = 0; i < els.length; ++i) {
      els[i].onclick = function(e) {
        e.preventDefault();
        var patternPartial = this.getAttribute('data-patternpartial');
        var panelID = this.getAttribute('data-panelid');
        panelsUtil.show(patternPartial, panelID);
      };
    }
    
    return templateRendered;
    
  }
function ( templateRendered , patternPartial ) { var els = templateRendered . querySelectorAll ( '#sg-' + patternPartial + '-tabs li' ) ; for ( var i = 0 ; i < els . length ; ++ i ) { els [ i ] . onclick = function ( e ) { e . preventDefault ( ) ; var patternPartial = this . getAttribute ( 'data-patternpartial' ) ; var panelID = this . getAttribute ( 'data-panelid' ) ; panelsUtil . show ( patternPartial , panelID ) ; } ; } return templateRendered ; }
Add click events to the template that was rendered
@param  {String}      the rendered template for the modal
@param  {String}      the pattern partial for the modal
Add click events to the template that was rendered