Fix hotpotatoes iframe in LP view - refs #8418

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 44861b5194
commit 2c0f5015ae
  1. 20
      main/exercise/showinframes.php
  2. 4
      main/template/default/learnpath/view.tpl

@ -75,13 +75,17 @@ if ($title =='') {
$nameTools = $title;
$noPHP_SELF = true;
$htmlHeadXtra[] = '
<script>
$(document).ready( function(){
var height = $(this).innerHeight() - 20;
$("#hotpotatoe").css("height", height)
});
</script>';
$htmlHeadXtra[] = /** @lang HTML */<<<HTML
<script>
$(document).on('ready', function () {
var iframe = document.getElementById('hotpotatoe');
iframe.onload = function () {
this.height = $(this.contentDocument.body).outerHeight(true)
};
});
</script>
HTML;
$interbreadcrumb[]= array ("url"=>"./exercise.php", "name"=> get_lang('Exercises'));
if ($origin == 'learnpath') {
@ -90,6 +94,6 @@ if ($origin == 'learnpath') {
Display::display_header($nameTools, "Exercise");
}
$url = $document_web_path.$doc_url.$user_id.'.t.html?time='.intval($time);
echo '<iframe id="hotpotatoe" width="100%" frameborder="0" src="'.$url.'"></iframe>';
echo '<iframe id="hotpotatoe" name="hotpotatoe" width="100%" height="100%" frameborder="0" src="'.$url.'"></iframe>';
echo '</body></html>';
exit;

@ -214,13 +214,13 @@
LPViewUtils.setHeightLPToc();
$('.scorm_item_normal a, #scorm-previous, #scorm-next').on('click', function () {
$('.lp-view-tabs').fadeOut();
$('.lp-view-tabs').animate({opacity: 0}, 500);
});
$('#learning_path_right_zone #lp-view-content iframe').on('load', function () {
$('.lp-view-tabs a[href="#lp-view-content"]').tab('show');
$('.lp-view-tabs').fadeIn();
$('.lp-view-tabs').animate({opacity: 1}, 500);
});
loadForumThread({{ lp_id }}, {{ lp_current_item_id }});

Loading…
Cancel
Save