Skip to content

Commit 242794f

Browse files
authored
Merge pull request #514 from bnmajor/colabbugs
Colabbugs
2 parents 01f7e1d + e81ff77 commit 242794f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

itkwidgets/viewer.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def run(self, ctx):
8484
name=f"itkwidgets viewer {_viewer_count}",
8585
type="itk-vtk-viewer",
8686
src="https://kitware.github.io/itk-vtk-viewer/app",
87-
fullscreen=False,
87+
fullscreen=True,
8888
data=self.init_data,
8989
# config should be a python data dictionary and can't be a string e.g. 'pydata-sphinx',
9090
config=config,
@@ -119,15 +119,9 @@ async def create_screenshot(self):
119119
def update_screenshot(self, base64_image):
120120
html = HTML(
121121
f'''
122-
<img id=screenshot_{self.wid} src={base64_image}>
123-
<script id="script_{self.wid}" type="text/javascript">
124-
var container = document.getElementById("script_{self.wid}").parentNode;
122+
<img id="screenshot_{self.wid}" src={base64_image}>
123+
<script type="text/javascript">
125124
var image = document.getElementById("screenshot_{self.wid}");
126-
if (!image) {{
127-
image = document.createElement("img");
128-
image.id = "screenshot_{self.wid}";
129-
container.appendChild(image);
130-
}}
131125
image.src = "{base64_image}";
132126
var viewer = document.getElementById("{self.wid}");
133127
// Hide the static image if the Viewer is visible

0 commit comments

Comments
 (0)