From ec9127d2452698a09432f2dbb7bb133acb332864 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 16 Nov 2018 12:39:57 +0100 Subject: [PATCH] JI-915 Fix embed resizing issue with Chrome --- js/h5p-resizer.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/h5p-resizer.js b/js/h5p-resizer.js index 4ed65e0..ed78724 100644 --- a/js/h5p-resizer.js +++ b/js/h5p-resizer.js @@ -20,6 +20,10 @@ // Make iframe responsive iframe.style.width = '100%'; + // Bugfix for Chrome: Force update of iframe width. If this is not done the + // document size may not be updated before the content resizes. + iframe.getBoundingClientRect(); + // Tell iframe that it needs to resize when our window resizes var resize = function () { if (iframe.contentWindow) {