Skip to content

Commit

Permalink
Merge pull request #93 from openworm/feature/281a
Browse files Browse the repository at this point in the history
#281 Added loader to python console
  • Loading branch information
tarelli authored Sep 4, 2019
2 parents ff00e62 + 96eee8e commit db00a7e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions js/components/interface/pythonConsole/PythonConsole.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,27 @@
define(function (require) {
var React = require('react');
var CreateClass = require('create-react-class');
var { CircularProgress } = require('@material-ui/core')
require('./PythonConsole.less');
$.widget.bridge('uitooltip', $.ui.tooltip);


return CreateClass({
getInitialState: function () {
return { loading: true };
},

componentDidMount: function () {
GEPPETTO.on('jupyter_geppetto_extension_ready', data => {
this.setState({ loading: false })
});
},


componentWillUnmount: function () {
GEPPETTO.off('jupyter_geppetto_extension_ready')
},

render: function () {

return (
Expand All @@ -21,9 +37,13 @@ define(function (require) {
allowtransparency="true"
style={{
width:'100%',
visibility: this.state.loading ? "hidden" : "visible",
height:this.props.iframeHeight + 'px'
}}>
</iframe>
{this.state.loading && <CircularProgress
style={{ position: 'absolute', left: 0, right: 0, bottom: 0, top: 0, margin: 'auto' }}
/>}
</div>
);
}
Expand Down

0 comments on commit db00a7e

Please sign in to comment.