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.
This commit is contained in:
stronk7 2007-09-02 12:14:08 +00:00
parent 4b82ca47e8
commit 10edb2a075
2 changed files with 11 additions and 3 deletions

View File

@ -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;
}

View File

@ -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