Skip to content

Commit

Permalink
Update code block heights in browser, for #266.
Browse files Browse the repository at this point in the history
  • Loading branch information
donkirkby committed Jul 5, 2020
1 parent b229f32 commit 7826233
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion html/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
.page-footer { height: 3em }

.editor-pane {
height: 25em;
width: 50%;
position: relative;
}
Expand Down
7 changes: 5 additions & 2 deletions html/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Editor extends Component {
this.setState({selectedLine: this.props.selectedLine});
this.content.current.editor.gotoLine(this.props.selectedLine+1);
}
this.content.current.editor.resize();
}

render() {
Expand Down Expand Up @@ -177,7 +178,8 @@ class CodeSample extends Component {
progressBar = null,
outputHeaders = null,
outputSection = null,
resetButton = null;
resetButton = null,
lineCount = 1 + this.state.source.split(/\r\n|\r|\n/).length;
if (this.state.isLive) {
displayEditor = <div className="editor-pane">
<Editor
Expand Down Expand Up @@ -224,7 +226,8 @@ class CodeSample extends Component {
return (
<div className="codeSample">
<div className="editor-wrapper">
<div className="editor-pane">
<div className="editor-pane"
style={{height: lineCount*18 + "px"}}>
<Editor
value={this.state.source}
scrollTop={this.state.scrollTop}
Expand Down

0 comments on commit 7826233

Please sign in to comment.