Skip to content

fixes #945 #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions client/modules/IDE/components/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ class Editor extends React.Component {
'editor--options': this.props.editorOptionsVisible
});

const editorHolderClass = classNames({
'editor-holder': true,
'editor-holder--hidden': this.props.file.fileType === 'folder' || this.props.file.url
});

return (
<section
title="code editor"
Expand Down Expand Up @@ -322,7 +327,7 @@ class Editor extends React.Component {
/>
</div>
</header>
<div ref={(element) => { this.codemirrorContainer = element; }} className="editor-holder" >
<div ref={(element) => { this.codemirrorContainer = element; }} className={editorHolderClass} >
</div>
<EditorAccessibility
lintMessages={this.props.lintMessages}
Expand Down Expand Up @@ -352,7 +357,9 @@ Editor.propTypes = {
file: PropTypes.shape({
name: PropTypes.string.isRequired,
content: PropTypes.string.isRequired,
id: PropTypes.string.isRequired
id: PropTypes.string.isRequired,
fileType: PropTypes.string.isRequired,
url: PropTypes.string.isRequired
}).isRequired,
editorOptionsVisible: PropTypes.bool.isRequired,
showEditorOptions: PropTypes.func.isRequired,
Expand Down
3 changes: 3 additions & 0 deletions client/styles/components/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ pre.CodeMirror-line {
height: calc(100% - #{29 / $base-font-size}rem);
width: 100%;
position: absolute;
&.editor-holder--hidden {
display: none;
}
}

.editor__header {
Expand Down