From f090e651e1eab040e10576c614a3ffa3a5124b7c Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 23 Aug 2017 12:44:15 +0200 Subject: [PATCH] HFP-1405 Fix targeting wrong parent iframe element Just in case there are two elements with the same ID avoid misbehaving --- js/h5p.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p.js b/js/h5p.js index aee90e2..dd74a79 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -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.