Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lms/templates/courseware/courseware-chromeless.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,11 @@
% endif

% if is_learning_mfe:
## TODO: Remove console.log statements after production debugging
<script type="text/javascript">
(function() {
// If this view is rendered in an iframe within the learning microfrontend app
// it will report the height of its contents to the parent window when the
// document loads, window resizes, or DOM mutates.
console.log('MFE', 'Start script', document.referrer);
if (window !== window.parent) {
document.body.className += ' view-in-mfe';
var lastHeight = window.offsetHeight;
Expand All @@ -132,13 +130,10 @@
// Note: event is actually an Array of MutationRecord objects
// when fired from the MutationObserver
var eventType = event.type || 'mutate';
console.log('MFE', 'Handle resize', eventType);

var newHeight = contentElement.offsetHeight;
var newWidth = contentElement.offsetWidth;

if (eventType !== 'load' && newWidth === lastWidth && newHeight === lastHeight) {
console.log('MFE', 'Ignore resize', newWidth, newHeight, eventType);
return;
}

Expand All @@ -161,7 +156,6 @@
// height. This window.scrollTo is an attempt to keep the content at the
// top of the page. See TNL-7094
window.scrollTo(0, 0);
console.log('MFE', 'Did resize', newWidth, newHeight, eventType);
}

// Create an observer instance linked to the callback function
Expand All @@ -172,7 +166,6 @@

window.addEventListener('load', dispatchResizeMessage);
window.addEventListener('resize', dispatchResizeMessage);
console.log('MFE', 'Bind events to element', contentElement);
}
}());
</script>
Expand Down