diff --git a/openedxscorm/scormxblock.py b/openedxscorm/scormxblock.py index 92d1e74..e8a7b3b 100644 --- a/openedxscorm/scormxblock.py +++ b/openedxscorm/scormxblock.py @@ -242,6 +242,7 @@ def student_view(self, context=None): "popup_width": self.width or 800, "popup_height": self.height or 800, "scorm_data": self.scorm_data, + "block_height": self.height or 450, }, ) return frag diff --git a/openedxscorm/static/js/src/scormxblock.js b/openedxscorm/static/js/src/scormxblock.js index d11f495..1391872 100644 --- a/openedxscorm/static/js/src/scormxblock.js +++ b/openedxscorm/static/js/src/scormxblock.js @@ -54,12 +54,16 @@ function ScormXBlock(runtime, element, settings) { function onFullscreenChange(e) { if (isFullscreen()) { $(e.target).addClass("fullscreen-enabled"); + if (settings.block_height > screen.height) { + $(e.target).css("height", screen.height); + } } else { $(e.target).removeClass("fullscreen-enabled"); + $(e.target).css("height", settings.block_height); } // This is required to trigger the actual content resize in some packages window.dispatchEvent(new Event('resize')); - } +} // Popup window function initPopupWindow() {