Skip to content

Commit 861a40d

Browse files
authored
Merge pull request #231 from cathalmccabe/master
Fix Iframe display issue
2 parents 2246977 + bad8105 commit 861a40d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

metakernel/magics/jigsaw_magic.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ class JigsawMagic(Magic):
2424
'-w', '--workspace', action='store', default=None,
2525
help='use the provided name as workspace filename'
2626
)
27-
def line_jigsaw(self, language, workspace=None):
27+
@option(
28+
'-h', '--height', action='store', default=350,
29+
help='set height of iframe '
30+
)
31+
def line_jigsaw(self, language, workspace=None, height=350):
2832
"""
2933
%jigsaw LANGUAGE - show visual code editor/generator
3034
@@ -33,7 +37,7 @@ def line_jigsaw(self, language, workspace=None):
3337
Examples:
3438
%jigsaw Processing
3539
%jigsaw Python
36-
%jigsaw Processing --workspace workspace1
40+
%jigsaw Processing --workspace workspace1 --height 600
3741
"""
3842
# Copy iframe html to here (must come from same domain):
3943
# Make up a random workspace name:
@@ -184,9 +188,8 @@ def line_jigsaw(self, language, workspace=None):
184188
}
185189
"""
186190
script = script.replace("MYWORKSPACENAME", workspace_filename);
187-
iframe = """<iframe src="%s" width="100%%" height="350" style="resize: both; overflow: auto;"></iframe>""" % html_filename
188191
self.kernel.Display(Javascript(script))
189-
self.kernel.Display(IFrame(iframe))
192+
self.kernel.Display(IFrame(html_filename, width='100%', height=height))
190193

191194
def register_magics(kernel):
192195
kernel.register_magics(JigsawMagic)

0 commit comments

Comments
 (0)