Skip to content

Commit 5d6095f

Browse files
authored
Merge pull request #726 from MetaCell/feature/netpyne-150
NETPYNE-150: python console height fixed
2 parents 394e1c0 + 3efc8be commit 5d6095f

5 files changed

Lines changed: 260 additions & 321 deletions

File tree

webapp/components/general/NetPyNEPythonConsole.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
import React, { Component } from 'react';
2-
2+
import ReactResizeDetector from 'react-resize-detector';
33
import { PythonConsole } from '@metacell/geppetto-meta-ui/python-console/PythonConsole';
44

55
export class NetPyNEPythonConsole extends Component {
6-
76
shouldComponentUpdate (nextProps) {
87
if (this.props.extensionLoaded !== nextProps.extensionLoaded) {
98
return true;
109
}
1110
return false;
1211
}
1312

14-
componentWillUnmount() {
15-
console.info("unmounting python console");
16-
}
17-
18-
componentDidMount() {
19-
13+
componentWillUnmount () {
14+
console.info('unmounting python console');
2015
}
2116

22-
render() {
17+
render () {
2318
const notebookName = GEPPETTO_CONFIGURATION.notebookName || "notebook.ipynb";
24-
return <PythonConsole pythonNotebookPath={`notebooks/${notebookName}`} extensionLoaded={this.props.extensionLoaded} />
19+
return (
20+
<ReactResizeDetector handleWidth handleHeight>
21+
{({ width, height }) => <PythonConsole pythonNotebookPath={`notebooks/${notebookName}`} extensionLoaded={this.props.extensionLoaded} iframeHeight={height} />}
22+
</ReactResizeDetector>
23+
);
2524
}
2625
}
2726

webapp/dev_package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"react-dom": "^16.4.0",
3636
"react-json-view": "^1.21.3",
3737
"react-redux": "^7.2.0",
38+
"react-resize-detector": "^6.7.4",
3839
"react-sortable-tree": "^2.8.0",
3940
"redux": "4.1.2",
4041
"sass": "^1.49.0",
@@ -78,7 +79,6 @@
7879
"less-loader": "^5.0.0",
7980
"mini-css-extract-plugin": "^0.7.0",
8081
"raw-loader": "^0.5.1",
81-
"react-resize-detector": "^6.7.4",
8282
"style-loader": "^0.13.2",
8383
"three": ">=0.111.0",
8484
"typedoc": "^0.11.1",

webapp/package.bak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"react-dom": "^16.4.0",
3636
"react-json-view": "^1.21.3",
3737
"react-redux": "^7.2.0",
38+
"react-resize-detector": "^6.7.4",
3839
"react-sortable-tree": "^2.8.0",
3940
"redux": "4.1.2",
4041
"sass": "^1.49.0",
@@ -78,7 +79,6 @@
7879
"less-loader": "^5.0.0",
7980
"mini-css-extract-plugin": "^0.7.0",
8081
"raw-loader": "^0.5.1",
81-
"react-resize-detector": "^6.7.4",
8282
"style-loader": "^0.13.2",
8383
"three": ">=0.111.0",
8484
"typedoc": "^0.11.1",

webapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"react-dom": "^16.4.0",
3636
"react-json-view": "^1.21.3",
3737
"react-redux": "^7.2.0",
38+
"react-resize-detector": "^6.7.4",
3839
"react-sortable-tree": "^2.8.0",
3940
"redux": "4.1.2",
4041
"sass": "^1.49.0",
@@ -78,7 +79,6 @@
7879
"less-loader": "^5.0.0",
7980
"mini-css-extract-plugin": "^0.7.0",
8081
"raw-loader": "^0.5.1",
81-
"react-resize-detector": "^6.7.4",
8282
"style-loader": "^0.13.2",
8383
"three": ">=0.111.0",
8484
"typedoc": "^0.11.1",

0 commit comments

Comments
 (0)