HFP-1405 Fix targeting wrong parent iframe element

Just in case there are two elements with the same ID avoid misbehaving
pull/42/head
Frode Petterson 2017-08-23 12:44:15 +02:00
parent 7c3a322fda
commit f090e651e1
1 changed files with 1 additions and 1 deletions

View File

@ -247,7 +247,7 @@ H5P.init = function (target) {
if (H5P.externalEmbed === false) {
// Internal embed
// Make it possible to resize the iframe when the content changes size. This way we get no scrollbars.
var iframe = window.parent.document.getElementById('h5p-iframe-' + contentId);
var iframe = window.frameElement;
var resizeIframe = function () {
if (window.parent.H5P.isFullscreen) {
return; // Skip if full screen.