]> git.mjollnir.org Git - moodle.git/commitdiff
Looking much better now! B-)
authorstronk7 <stronk7>
Mon, 24 Apr 2006 00:11:59 +0000 (00:11 +0000)
committerstronk7 <stronk7>
Mon, 24 Apr 2006 00:11:59 +0000 (00:11 +0000)
More tests tomorrow (IE, mainly)

mod/resource/type/ims/javascript.php
mod/resource/type/ims/resize.js
mod/resource/type/ims/resource.class.php

index 60741a9d2e318520aa6b99e7cc4df46ae786996b..0673bac4708d7f96fd688efd1126842d7252aa43 100644 (file)
@@ -18,9 +18,6 @@
         window.onresize = function() {
             resizeiframe($jsarg);
         };
-        window.onload = function() {
-            resizeiframe($jsarg);
-        };
         window.name='ims-cp-page';
     </script>\n";
 
index 54bac836879e5632ea9a1f3df49d1b75344875f6..a5df3e262533a019e4215f2d206e7c2f08768e60 100644 (file)
@@ -62,7 +62,7 @@ function resizeiframe (hasNav) {
                         footerHeight + 
                         imsnavHeight +
                         topMargin +
-                        bottomMargin;
+                        bottomMargin + 20; // +20 to save a minor vertical scroll always present!
 
     if (hasNav == true) {
         var navBarWidth = document.getElementById('ims-menudiv').offsetWidth;
@@ -70,7 +70,7 @@ function resizeiframe (hasNav) {
         document.getElementById('ims-menudiv').style.height = (winHeight - totalHeight)+'px';
     }
     else {
-        var iframeWidth = '99%';
+        var iframeWidth = (winWidth - 25)+'px';
     }
 
     if (hasNav == true) {
index 4a1e1a2cd6a73b9f7274b4ecd214c880579c2d6d..0c331c153f1ef653e828a10c555022866ca98316 100644 (file)
@@ -458,14 +458,8 @@ class resource_ims extends resource_base {
             }
         /// content - this produces everything else
             $this->print_ims($cm, $course, $items, $resource, $page);
-        /// moodle footer. no footer if it's in a popup - save space.
-            if ($resource->popup) {
-               echo "</div></div></body></html>";
-            }
-            else {
-            /// Putting the footer inside one div to be able to handle it
-               print_footer();
-            }
+        /// no Moodle footer (because we cannot insert there the resize script).
+               echo "</div></div><script type=\"text/javascript\">resizeiframe($jsarg);</script></body></html>";
 
         /// log it.
             add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
@@ -554,7 +548,7 @@ class resource_ims extends resource_base {
         }
         
     /// prints iframe filled with $fullurl
-        echo "<iframe id=\"".$contentframe."\" name=\"ims-contentframe\" src=\"{$fullurl}\"></iframe>"; //Content frame
+        echo "<iframe id=\"".$contentframe."\" name=\"".$contentframe."\" src=\"{$fullurl}\"></iframe>"; //Content frame
         echo '</div>';
     }