Skip to content

Commit

Permalink
fix: fullscreen page height (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinAoki authored Dec 4, 2024
1 parent ea54a52 commit c5d4f4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions openedxscorm/scormxblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def student_view(self, context=None):
"popup_width": self.width or 800,
"popup_height": self.height or 800,
"scorm_data": self.scorm_data,
"block_height": self.height or 450,
},
)
return frag
Expand Down
6 changes: 5 additions & 1 deletion openedxscorm/static/js/src/scormxblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@ function ScormXBlock(runtime, element, settings) {
function onFullscreenChange(e) {
if (isFullscreen()) {
$(e.target).addClass("fullscreen-enabled");
if (settings.block_height > screen.height) {
$(e.target).css("height", screen.height);
}
} else {
$(e.target).removeClass("fullscreen-enabled");
$(e.target).css("height", settings.block_height);
}
// This is required to trigger the actual content resize in some packages
window.dispatchEvent(new Event('resize'));
}
}

// Popup window
function initPopupWindow() {
Expand Down

0 comments on commit c5d4f4c

Please sign in to comment.