Embed function: moving the class 'gist-iframe' from the script to the iframe

This commit is contained in:
Simon Vieille 2015-11-20 22:36:31 +01:00
parent 183e5f4452
commit c9bb3585af
1 changed files with 1 additions and 1 deletions

View File

@ -13,6 +13,7 @@
iframe.setAttribute('frameborder', 0);
iframe.setAttribute('src', url);
iframe.setAttribute('style', 'width: 100%');
iframe.setAttribute('class', 'gist-iframe');
document.getElementById('gist-{{ gist.file }}-{{ commit }}').appendChild(iframe);
iFrameResize({}, iframe);
@ -21,7 +22,6 @@
if (typeof iFrameResize == 'undefined') {
var script = document.createElement('script');
script.setAttribute('id', 'gist-iframe-resizer');
script.setAttribute('class', 'gist-iframe');
script.setAttribute('src', '{{ app.request.getSchemeAndHttpHost() ~ web_path }}components/iframe-resizer/js/iframeResizer.min.js');
script.onload = iFrameResizeLoaded;
document.getElementsByTagName('head')[0].appendChild(script);