Skip to content

Commit

Permalink
Fix #774 - prettyPhoto position problem in IFRAME (mod_exescorm plugi…
Browse files Browse the repository at this point in the history
…n in fulscreen mode).
  • Loading branch information
ignaciogros committed Oct 28, 2024
1 parent 352d4f0 commit 087bb08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion exe/webui/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ var $exe = {

// See #774 (prettyPhoto contents in mod_exescorm)
moodleScormWieverGalleryFix : function(){
const pTop = 20;
if (!$exe.inIframe) return;
if (!top||!top.document.documentElement||typeof(top.document.documentElement.scrollTop)!='number') return;
if (!$("body").hasClass("exe-scorm")) return; // Is it a SCORM package?
Expand All @@ -492,7 +493,11 @@ var $exe = {
return;
}
if ($("#exescorm_object",top.document).length!=1) return;
$(".pp_pic_holder.pp_default").css("top",(top.document.documentElement.scrollTop+20)+"px");
var wrapper = $("#exescormpage",top.document);
if (wrapper.length!=1) return;
var elm = top.document.documentElement;
if (wrapper.hasClass("fullscreen")) elm = wrapper[0];
$(".pp_pic_holder.pp_default").css("top",(elm.scrollTop+pTop)+"px");
},

// Transform links to audios or videos (with rel^='lightbox') in links to inline content (see prettyPhoto documentation)
Expand Down

0 comments on commit 087bb08

Please sign in to comment.