patternlab/styleguide/public/styleguide/js/patternlab-viewer.js
function(switchText) {
    
    // note that the modal is active and set switchText
    if ((switchText === undefined) || (switchText)) {
      switchText = true;
      DataSaver.updateValue('modalActive', 'true');
      modalViewer.active = true;
    }
    
    // send a message to the pattern
    var obj = JSON.stringify({ 'event': 'patternLab.patternQuery', 'switchText': switchText });
    document.getElementById('sg-viewport').contentWindow.postMessage(obj, modalViewer.targetOrigin);
    
  }
function(switchText) {
    
    // note that the modal is active and set switchText
    if ((switchText === undefined) || (switchText)) {
      switchText = true;
      DataSaver.updateValue('modalActive', 'true');
      modalViewer.active = true;
    }
    
    // send a message to the pattern
    var obj = JSON.stringify({ 'event': 'patternLab.patternQuery', 'switchText': switchText });
    document.getElementById('sg-viewport').contentWindow.postMessage(obj, modalViewer.targetOrigin);
    
  }
function ( switchText ) { // note that the modal is active and set switchText if ( ( switchText === undefined ) || ( switchText ) ) { switchText = true ; DataSaver . updateValue ( 'modalActive' , 'true' ) ; modalViewer . active = true ; } // send a message to the pattern var obj = JSON . stringify ( { 'event' : 'patternLab.patternQuery' , 'switchText' : switchText } ) ; document . getElementById ( 'sg-viewport' ) . contentWindow . postMessage ( obj , modalViewer . targetOrigin ) ; }
ask the pattern for info so we can open the modal window and populate it
@param  {Boolean}      if the dropdown text should be changed
ask the pattern for info so we can open the modal window and populate it