Skip to content

Commit

Permalink
Merge pull request #132 from Pearson-Advance/kuipumu/fix-courseware-i…
Browse files Browse the repository at this point in the history
…frame-heigth

fix: courseware-chromeless.html iframe height
  • Loading branch information
kuipumu authored Oct 1, 2024
2 parents 4ae1637 + 44d1c52 commit be6e128
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lms/templates/courseware/courseware-chromeless.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,15 @@
// document loads, window resizes, or DOM mutates.
if (window !== window.parent) {
document.body.className += ' view-in-mfe';
var lastHeight = window.offsetHeight;
const extraHeight = 250; // Set extra height value.
var lastHeight = window.offsetHeight + extraHeight; // Add extra height to avoid clipping.
var lastWidth = window.offsetWidth;
var contentElement = document.getElementById('content');

function dispatchResizeMessage(event) {
// Note: event is actually an Array of MutationRecord objects when fired from the MutationObserver
var isLoadEvent = event.type === 'load';
var newHeight = contentElement.offsetHeight;
var newHeight = contentElement.offsetHeight + extraHeight; // Add extra height to avoid clipping.
var newWidth = contentElement.offsetWidth;
if (!isLoadEvent && newWidth === lastWidth && newHeight === lastHeight) {
// Monitor when any anchor tag is clicked, it is checked to make sure
Expand Down

0 comments on commit be6e128

Please sign in to comment.