File tree Expand file tree Collapse file tree
webapp/components/general Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,12 +74,26 @@ export class NetPyNEPythonConsole extends Component {
7474 if ( this . props . extensionLoaded !== nextProps . extensionLoaded ) {
7575 return true ;
7676 }
77+ const iframeStyle = {
78+ position : 'absolute' ,
79+ left : `${ offScreenLeft } px` ,
80+ width : '1px' ,
81+ height : '1px' ,
82+ } ;
83+ var iframeWindow = this . container . contentWindow ;
84+ const offScreenLeft = - window . innerWidth - 100 ; //plus additional buffer just in case
85+
7786 if ( nextProps . notebookVisible )
7887 {
79- var iframeWindow = this . container . contentWindow ;
8088 iframeWindow . onblur = this . handleIframeBlur ;
8189 iframeWindow . onfocus = this . handleIframeFocus ;
8290 }
91+ else {
92+ iframeWindow . position = 'absolute' ;
93+ iframeWindow . left = `${ offScreenLeft } px` ;
94+ iframeWindow . width = '1px' ;
95+ iframeWindow . height = '1px' ;
96+ }
8397 return false ;
8498 }
8599
@@ -104,14 +118,6 @@ export class NetPyNEPythonConsole extends Component {
104118
105119 render ( ) {
106120 const notebookName = GEPPETTO_CONFIGURATION . notebookName || "notebook.ipynb" ;
107- const offScreenLeft = - window . innerWidth - 100 ; //plus additional buffer just in case
108-
109- const iframeStyle = {
110- position : 'absolute' ,
111- left : `${ offScreenLeft } px` ,
112- width : '1px' ,
113- height : '1px' ,
114- } ;
115121
116122 return (
117123 < ReactResizeDetector handleWidth handleHeight >
@@ -120,7 +126,6 @@ export class NetPyNEPythonConsole extends Component {
120126 pythonNotebookPath = { `notebooks/${ notebookName } ` }
121127 extensionLoaded = { this . props . extensionLoaded }
122128 iframeHeight = { height }
123- style = { iframeStyle }
124129 />
125130 ) }
126131 </ ReactResizeDetector >
You can’t perform that action at this time.
0 commit comments