MDL-24738 - fix up height and width calculations for scorm player
authorPiers Harding <piers@ompka.net>
Wed, 24 Nov 2010 22:57:38 +0000 (22:57 +0000)
committerPiers Harding <piers@ompka.net>
Wed, 24 Nov 2010 22:57:38 +0000 (22:57 +0000)
mod/scorm/module.js
mod/scorm/styles.css

index 4bc1285..a18e905 100644 (file)
@@ -181,6 +181,9 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
                 if (newwidth > 600) {
                     scorm_layout_widget.setStyle('width', newwidth+'px');
                 }
+                else {
+                    scorm_layout_widget.setStyle('width', '600px');
+                }
             }
             // make sure that the max width of the TOC doesn't go to far
 
@@ -192,18 +195,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
                 left.set('width', (maxwidth - 10));
             }
 
-            var pageheight = scorm_get_htmlelement_size('page', 'height');
-            var layoutheight = scorm_get_htmlelement_size(scorm_layout_widget, 'height');
-            var newheight = layoutheight + parseInt(YAHOO.util.Dom.getViewportHeight()) - pageheight - 20;
-            if (newheight > 400) {
-                if (newheight > 768) {
-                    scorm_layout_widget.setStyle('height', '768px');
-                }
-                else {
-                    scorm_layout_widget.setStyle('height', newheight+'px');
-                }
-            }
-
+            scorm_layout_widget.setStyle('height', '100%');
             scorm_layout_widget.render();
             scorm_resize_frame();
 
@@ -306,7 +298,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
 
         scorm_layout_widget = new YAHOO.widget.Layout('scorm_layout', {
             minWidth: 255,
-            minHeight: 400,
+            minHeight: 600,
             units: [
                 { position: 'left', body: 'scorm_toc', header: toc_title, width: 250, resize: true, gutter: '2px 5px 5px 2px', collapse: true, minWidth:250, maxWidth: 590},
                 { position: 'center', body: '<div id="scorm_content"></div>', gutter: '2px 5px 5px 2px', scroll: true}
index 5a8a50e..913ef23 100644 (file)
@@ -4,14 +4,14 @@
 .path-mod-scorm .scorm-right {text-align: right;}
 .path-mod-scorm .scoframe {position: relative;width: 100%;height: 100%;}
 
-#page-mod-scorm-player #scormobject {height: 400px;}
+#page-mod-scorm-player #scormobject {height: 100%;}
 #page-mod-scorm-player #scormtop {position: relative;width: 100%;height: 30px;}
 #page-mod-scorm-player #scormbrowse {position: absolute;left: 5px;top: 0px;}
 #page-mod-scorm-player #scormnav {position: absolute;right: 5px;top: 0px;text-align: center;top: 3px;width: 100%;}
-#page-mod-scorm-player #scormbox {width: 74%;position: absolute;right: 0px;top: 0px;}
-#page-mod-scorm-player #scormpage {position: relative;width: 100%;}
+#page-mod-scorm-player #scormbox {width: 74%;height: 100%;position: absolute;right: 0px;top: 0px;}
+#page-mod-scorm-player #scormpage {position: relative;width: 100%;height: 100%;}
 #page-mod-scorm-player #scormpage #toctree {position:relative;width:100%;overflow-x: auto;overflow-y: auto;}
-#page-mod-scorm-player #tocbox {position: relative;left: 0px;width: 80%;font-size: 0.8em;}
+#page-mod-scorm-player #tocbox {position: relative;left: 0px;width: 100%;height: 100%;font-size: 0.8em;}
 #page-mod-scorm-player #tochead {position: relative;text-align: center;top: 3px;height: 30px;}
 
 #page-mod-scorm-player .toc,