Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(lab): allow params to be passed to iframes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmolhoek authored and danbucholtz committed Jun 21, 2017
1 parent ccb4042 commit dabfdd1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lab/static/js/lab.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ function showDevice(device, isShowing) {
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';
}
Expand Down

0 comments on commit dabfdd1

Please sign in to comment.