Skip to content

Commit 0c4a11f

Browse files
committed
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.
1 parent b4f4849 commit 0c4a11f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mfr/server/static/css/mfr.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ This CSS was stripped out of base.css from the osf-style repo.
4242
align-items: center;
4343
width: 100%;
4444
height: 250px;
45+
top: 0;
46+
left: 0;
4547
}
4648

4749
.embed-responsive-pdf {
4850
padding-bottom: 95%;
4951
}
5052

5153
#mfrIframe iframe {
52-
display: none;
54+
opacity: 0.0;
5355
}
5456

5557
#mfrIframe {

mfr/server/static/js/mfr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
self.pymParent.el.appendChild(self.spinner);
8383
$(self.pymParent.iframe).on('load', function() {
8484
self.pymParent.el.removeChild(self.spinner);
85-
this.style.display = "block"
85+
this.style.opacity = "1.0"
8686
})
8787

8888
self.pymParent.onMessage('embed', function(message) {

0 commit comments

Comments
 (0)