Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
d608b434
Commit
d608b434
authored
4 years ago
by
stvn
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Add logging to Learning MFE iframe, temporarily"
This reverts commit
2ddc35cd
.
parent
8ed8d1ed
No related branches found
Branches containing commit
Tags
release-2021-02-03-12.16
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/templates/courseware/courseware-chromeless.html
+0
-7
0 additions, 7 deletions
lms/templates/courseware/courseware-chromeless.html
with
0 additions
and
7 deletions
lms/templates/courseware/courseware-chromeless.html
+
0
−
7
View file @
d608b434
...
...
@@ -115,13 +115,11 @@ ${HTML(fragment.foot_html())}
% 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
;
...
...
@@ -132,13 +130,10 @@ ${HTML(fragment.foot_html())}
// 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
;
}
...
...
@@ -161,7 +156,6 @@ ${HTML(fragment.foot_html())}
// 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
...
...
@@ -172,7 +166,6 @@ ${HTML(fragment.foot_html())}
window
.
addEventListener
(
'
load
'
,
dispatchResizeMessage
);
window
.
addEventListener
(
'
resize
'
,
dispatchResizeMessage
);
console
.
log
(
'
MFE
'
,
'
Bind events to element
'
,
contentElement
);
}
}());
</script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment