lab/static/js/lab.js
function showDevice(device, isShowing) {
  $('#device-' + device).checked = isShowing;

  var rendered = $('#' + device);
  if(!rendered) {
    var template = $('#' + device + '-frame-template');
    var clone = document.importNode(template, true);
    $('preview').appendChild(clone.content);
    //check for extra params in location.url to pass on to iframes
    var params = document.location.href.split('?');
    if (params) {
      var newparams = params[params.length - 1];
      var oldsrc = $('preview .frame').getAttribute('src');
      $('preview .frame').setAttribute('src', oldsrc + '&' + newparams);
    }
  } else {
    rendered.style.display = isShowing ? '' : 'none';
  }
}
function showDevice(device, isShowing) {
  $('#device-' + device).checked = isShowing;

  var rendered = $('#' + device);
  if(!rendered) {
    var template = $('#' + device + '-frame-template');
    var clone = document.importNode(template, true);
    $('preview').appendChild(clone.content);
    //check for extra params in location.url to pass on to iframes
    var params = document.location.href.split('?');
    if (params) {
      var newparams = params[params.length - 1];
      var oldsrc = $('preview .frame').getAttribute('src');
      $('preview .frame').setAttribute('src', oldsrc + '&' + newparams);
    }
  } else {
    rendered.style.display = isShowing ? '' : 'none';
  }
}
function showDevice ( device , isShowing ) { $ ( '#device-' + device ) . checked = isShowing ; var rendered = $ ( '#' + device ) ; if ( ! rendered ) { var template = $ ( '#' + device + '-frame-template' ) ; var clone = document . importNode ( template , true ) ; $ ( 'preview' ) . appendChild ( clone . content ) ; //check for extra params in location.url to pass on to iframes var params = document . location . href . split ( '?' ) ; if ( params ) { var newparams = params [ params . length - 1 ] ; var oldsrc = $ ( 'preview .frame' ) . getAttribute ( 'src' ) ; $ ( 'preview .frame' ) . setAttribute ( 'src' , oldsrc + '&' + newparams ) ; } } else { rendered . style . display = isShowing ? '' : 'none' ; } }
Show one of the devices
Show one of the devices