Skip to content

Commit cf743a6

Browse files
committed
Anchor loader pulsar to avoid jumping around
* Hide iframe until load message is received. * Use absolute positioning for loader.
1 parent 104d39a commit cf743a6

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

mfr/server/static/css/mfr.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ This CSS was stripped out of base.css from the osf-style repo.
3535
background-color: #337AB7;
3636
}
3737

38+
.ball-scale {
39+
position: absolute;
40+
display: flex;
41+
justify-content: center;
42+
align-items: center;
43+
width: 100%;
44+
height: 250px;
45+
}
46+
3847
.embed-responsive-pdf {
3948
padding-bottom: 95%;
4049
}
50+
51+
#mfrIframe iframe {
52+
display: none;
53+
}
54+
55+
#mfrIframe {
56+
min-height: 250px;
57+
}

mfr/server/static/js/mfr.child.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
});
1818
});
19-
});
19+
}, false);
2020

2121
window.addEventListener('resize', function () {
2222
window.pymChild.sendHeight();

mfr/server/static/js/mfr.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@
8383
self.pymParent.iframe.setAttribute('sandbox', 'allow-scripts allow-popups allow-same-origin');
8484

8585
self.pymParent.el.appendChild(self.spinner);
86-
$(self.pymParent.iframe).on('load', function () {
86+
$(self.pymParent.iframe).on('load', function() {
8787
self.pymParent.el.removeChild(self.spinner);
88-
});
88+
this.style.display = "block"
89+
})
8990

9091
self.pymParent.onMessage('embed', function(message) {
9192
_addClass(self.pymParent.el, 'embed-responsive');

0 commit comments

Comments
 (0)