From 468d2770c520bb85a22d8eaac5fb255b5e376ca2 Mon Sep 17 00:00:00 2001 From: Brian Barnes Date: Fri, 13 Mar 2015 11:46:32 +1300 Subject: [PATCH] MDL-47500 scorm: improved height calculation --- mod/scorm/module.js | 8 +++++--- mod/scorm/styles.css | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/scorm/module.js b/mod/scorm/module.js index 287bccb847e..0f7ef36ca4a 100644 --- a/mod/scorm/module.js +++ b/mod/scorm/module.js @@ -298,9 +298,11 @@ M.mod_scorm.init = function(Y, nav_display, navposition_left, navposition_top, h } // Calculate the rough new height from the viewport height. - newheight = Y.one('body').get('winHeight') - 5; - if (newheight < 600) { - newheight = 600; + var newheight = Y.one('body').get('winHeight') - 5 + - Y.one('#scorm_layout').getY() + - window.pageYOffset; + if (newheight < 680 || isNaN(newheight)) { + newheight = 680; } Y.one('#scorm_layout').setStyle('height', newheight); diff --git a/mod/scorm/styles.css b/mod/scorm/styles.css index a865799ccc8..b41f8e80692 100644 --- a/mod/scorm/styles.css +++ b/mod/scorm/styles.css @@ -273,6 +273,10 @@ *word-spacing: -0.43em; } +#scorm_layout { + margin-bottom: 50px; +} + /** * Opera as of 12 on Windows needs word-spacing. * The ".opera-only" selector is used to prevent actual prefocus styling