File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ var curVisualizerID = 1; // global to uniquely identify each ExecutionVisualizer
7272// codeDivHeight - maximum height of #pyCodeOutputDiv (in integer pixels)
7373// codeDivWidth - maximum width of #pyCodeOutputDiv (in integer pixels)
7474// editCodeBaseURL - the base URL to visit when the user clicks 'Edit code' (if null, then 'Edit code' link hidden)
75- // embeddedMode - make the widget narrower horizontally and disable breakpoints
75+ // embeddedMode - shortcut for hideOutput=true, codeDivWidth=350, codeDivHeight=400
7676// updateOutputCallback - function to call (with 'this' as parameter)
7777// whenever this.updateOutput() is called
7878// (BEFORE rendering the output display)
@@ -261,8 +261,14 @@ ExecutionVisualizer.prototype.render = function() {
261261 if ( this . params . embeddedMode ) {
262262 this . params . hideOutput = true ; // put this before hideOutput handler
263263
264- this . params . codeDivWidth = 350 ;
265- this . params . codeDivHeight = 400 ;
264+ // don't override if they've already been set!
265+ if ( this . params . codeDivWidth === undefined ) {
266+ this . params . codeDivWidth = 350 ;
267+ }
268+
269+ if ( this . params . codeDivHeight === undefined ) {
270+ this . params . codeDivHeight = 400 ;
271+ }
266272 }
267273
268274
You can’t perform that action at this time.
0 commit comments