Skip to content

Commit c2df461

Browse files
NyanHelsingcslzchen
authored andcommitted
Please update the commit message based on the new diff
[skip ci] Three commits that has been squashed: Anchor loader pulsar to avoid jumping around * Hide iframe until load message is received. * Use absolute positioning for loader. Fix iframe hiding to avoid breaking stl, pdb, and images * Switch to using `opacity: 0.0` instead of `display: none` to hide iframes that are still being built. Use of `display: none` was causing OpenGL-based renderers (pdb and 3D-object) to fail, and was disabling image zoom for large images. Only style the mfr loader'
1 parent 7ce466b commit c2df461

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

mfr/server/static/css/mfr.css

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
This CSS was stripped out of base.css from the osf-style repo.
44
*/
55

6-
.ball-pulse > div:nth-child(0) {
6+
#mfrIframe .ball-pulse > div:nth-child(0) {
77
-webkit-animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
88
animation: scale 0.75s -0.36s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
99
}
10-
.ball-pulse > div:nth-child(1) {
10+
#mfrIframe .ball-pulse > div:nth-child(1) {
1111
-webkit-animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
1212
animation: scale 0.75s -0.24s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
1313
}
14-
.ball-pulse > div:nth-child(2) {
14+
#mfrIframe .ball-pulse > div:nth-child(2) {
1515
-webkit-animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
1616
animation: scale 0.75s -0.12s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
1717
}
18-
.ball-pulse > div:nth-child(3) {
18+
#mfrIframe .ball-pulse > div:nth-child(3) {
1919
-webkit-animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
2020
animation: scale 0.75s 0s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08);
2121
}
22-
.ball-pulse > div {
22+
#mfrIframe .ball-pulse > div {
2323
background-color: #fff;
2424
width: 15px;
2525
height: 15px;
@@ -31,10 +31,29 @@ This CSS was stripped out of base.css from the osf-style repo.
3131
}
3232

3333

34-
.ball-dark > div {
34+
#mfrIframe .ball-dark > div {
3535
background-color: #337AB7;
3636
}
3737

38-
.embed-responsive-pdf {
38+
#mfrIframe .ball-scale {
39+
position: absolute;
40+
display: flex;
41+
justify-content: center;
42+
align-items: center;
43+
width: 100%;
44+
height: 250px;
45+
top: 0;
46+
left: 0;
47+
}
48+
49+
#mfrIframe .embed-responsive-pdf {
3950
padding-bottom: 95%;
4051
}
52+
53+
#mfrIframe iframe {
54+
opacity: 0.0;
55+
}
56+
57+
#mfrIframe {
58+
min-height: 250px;
59+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
});
1919
});
20-
});
20+
}, false);
2121

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

mfr/server/static/js/mfr.js

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

8282
self.pymParent.el.appendChild(self.spinner);
83-
$(self.pymParent.iframe).on('load', function () {
83+
$(self.pymParent.iframe).on('load', function() {
8484
self.pymParent.el.removeChild(self.spinner);
85-
});
85+
this.style.opacity = "1.0"
86+
})
8687

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

0 commit comments

Comments
 (0)