]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14492 - Provide feedback to user about redirect delay in loadsco.php. Add sanity...
authorpiers <piers>
Fri, 29 Aug 2008 04:10:20 +0000 (04:10 +0000)
committerpiers <piers>
Fri, 29 Aug 2008 04:10:20 +0000 (04:10 +0000)
mod/scorm/rd.js

index 8a4d29a32f7536e2c9b94dab946ed7b1bfe3fdea..c8c3038e01993b8029af7d89554051152fbe471b 100644 (file)
@@ -14,6 +14,7 @@ function scorm_get_element_style(obj, prop, cssProp) {
 }
 
 function scorm_resize (cwidth, cheight) {
+
     var winwidth = 0, winheight = 0;
     if( typeof( window.innerWidth ) == 'number' ) {
         //Non-IE
@@ -60,21 +61,29 @@ function scorm_resize (cwidth, cheight) {
                         scormtopheight+
                         topmargin +
                         bottommargin+10; // +10 to save a minor vertical scroll always present!
-                        
+
     var totalheighttoc = totalheight+imsnavheight;
-    // override total height with configured height if it is smaller
+    // override total height with configured height if it is defined
     if (cheight > 0) {
       winheight = cheight;
+    }
+    var finalheighttoc = winheight - totalheighttoc;
+    if (finalheighttoc <= 0) {
+        finalheighttoc = winheight;
+    }                        
+    var finalheight = winheight - totalheight;
+    if (finalheight <= 0) {
+        finalheight = winheight;
     }                        
     var toctree = document.getElementById('toctree');
     if (toctree != null){
         var toctreeHeight = toctree.offsetHeight;
-        document.getElementById('toctree').style.height = (winheight - totalheighttoc) + 'px';
+        document.getElementById('toctree').style.height = finalheighttoc + 'px';
         var scoframe2 = document.getElementById('scoframe1');
-        document.getElementById('scormobject').style.height = (winheight - totalheight) + 'px';
+        document.getElementById('scormobject').style.height = finalheight + 'px';
     }else{
         var scoframe2 = document.getElementById('scoframe1');
-        document.getElementById('scormobject').style.height = (winheight - totalheight) + 'px';
+        document.getElementById('scormobject').style.height = finalheight + 'px';
     }
 
     // resize the content container too to move the footer below the SCORM content
@@ -82,7 +91,14 @@ function scorm_resize (cwidth, cheight) {
     if (contenti3) {
         contenti3.style.height = (winheight - totalheight + 30) + 'px';
     } else {
-       document.getElementById('content').style.height = (winheight - totalheight + 30) + 'px';
+       document.getElementById('content').style.height = (finalheight + 30) + 'px';
+    }
+     // resize the content container too to move the footer below the SCORM content
+    var contenti3 = document.getElementById('content-i3');
+    if (contenti3) {
+        contenti3.style.height = (finalheight + 30) + 'px';
+    } else {
+        document.getElementById('content').style.height = (finalheight + 30) + 'px';
     }
 }
--->
+-->
\ No newline at end of file