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

Commit dabfdd1

Browse files
mmolhoekdanbucholtz
authored andcommitted
fix(lab): allow params to be passed to iframes
1 parent ccb4042 commit dabfdd1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lab/static/js/lab.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ function showDevice(device, isShowing) {
4848
var template = $('#' + device + '-frame-template');
4949
var clone = document.importNode(template, true);
5050
$('preview').appendChild(clone.content);
51+
//check for extra params in location.url to pass on to iframes
52+
var params = document.location.href.split('?')
53+
if (params) {
54+
var newparams = params[params.length - 1]
55+
var oldsrc = $('preview .frame').getAttribute('src')
56+
$('preview .frame').setAttribute('src', oldsrc + '&' + newparams)
57+
}
5158
} else {
5259
rendered.style.display = isShowing ? '' : 'none';
5360
}

0 commit comments

Comments
 (0)