From 10edb2a075c83f4b12a6f63031f4eca00d7275f4 Mon Sep 17 00:00:00 2001 From: stronk7 <stronk7> Date: Sun, 2 Sep 2007 12:14:08 +0000 Subject: [PATCH] Now the customcorners (T/F) flag is passed to the resizeiframe() script. Next-step: perform some extra calculations there to resize the iframe properly under customcorners. --- mod/resource/type/ims/javascript.php | 12 ++++++++++-- mod/resource/type/ims/resize.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mod/resource/type/ims/javascript.php b/mod/resource/type/ims/javascript.php index 68640e820b..e91488c71f 100644 --- a/mod/resource/type/ims/javascript.php +++ b/mod/resource/type/ims/javascript.php @@ -9,6 +9,14 @@ /// We use this globals to be able to generate the proper JavaScripts global $jsarg, $standard_javascript; +/// Let's know if we are using a customcorners theme. It implies new calculations +/// within the resizeiframe function. + if (!empty($THEME->customcorners)) { + $customcorners = 'true'; + } else { + $customcorners = 'false'; + } + /// Load IMS needed JavaScript /// The dummy LMS API hack to stop some SCORM packages giving errors. echo "<script type=\"text/javascript\" src=\"$CFG->wwwroot/mod/resource/type/ims/dummyapi.js\"></script>\n"; @@ -16,7 +24,7 @@ echo " <script type=\"text/javascript\" src=\"$CFG->wwwroot/mod/resource/type/ims/resize.js\"></script>\n"; echo " <script type=\"text/javascript\"> window.onresize = function() { - resizeiframe($jsarg); + resizeiframe($jsarg, $customcorners); }; window.name='ims-cp-page'; @@ -26,7 +34,7 @@ var cfnv = document.getElementById('ims-contentframe-no-nav'); if (cf || cfnv) { - resizeiframe($jsarg); + resizeiframe($jsarg, $customcorners); clearInterval(ourInterval); return true; } diff --git a/mod/resource/type/ims/resize.js b/mod/resource/type/ims/resize.js index aeb7d519eb..93913ad26a 100644 --- a/mod/resource/type/ims/resize.js +++ b/mod/resource/type/ims/resize.js @@ -17,7 +17,7 @@ function getElementStyle(obj, prop, cssProp) { return ret; } -function resizeiframe (hasNav) { +function resizeiframe (hasNav, customCorners) { var winWidth = 0, winHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE -- 2.39.5