Skip to content

Commit 0b24938

Browse files
authored
fixes #945 (#1102)
1 parent 68f3d14 commit 0b24938

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

client/modules/IDE/components/Editor.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ class Editor extends React.Component {
290290
'editor--options': this.props.editorOptionsVisible
291291
});
292292

293+
const editorHolderClass = classNames({
294+
'editor-holder': true,
295+
'editor-holder--hidden': this.props.file.fileType === 'folder' || this.props.file.url
296+
});
297+
293298
return (
294299
<section
295300
title="code editor"
@@ -322,7 +327,7 @@ class Editor extends React.Component {
322327
/>
323328
</div>
324329
</header>
325-
<div ref={(element) => { this.codemirrorContainer = element; }} className="editor-holder" >
330+
<div ref={(element) => { this.codemirrorContainer = element; }} className={editorHolderClass} >
326331
</div>
327332
<EditorAccessibility
328333
lintMessages={this.props.lintMessages}
@@ -352,7 +357,9 @@ Editor.propTypes = {
352357
file: PropTypes.shape({
353358
name: PropTypes.string.isRequired,
354359
content: PropTypes.string.isRequired,
355-
id: PropTypes.string.isRequired
360+
id: PropTypes.string.isRequired,
361+
fileType: PropTypes.string.isRequired,
362+
url: PropTypes.string.isRequired
356363
}).isRequired,
357364
editorOptionsVisible: PropTypes.bool.isRequired,
358365
showEditorOptions: PropTypes.func.isRequired,

client/styles/components/_editor.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ pre.CodeMirror-line {
328328
height: calc(100% - #{29 / $base-font-size}rem);
329329
width: 100%;
330330
position: absolute;
331+
&.editor-holder--hidden {
332+
display: none;
333+
}
331334
}
332335

333336
.editor__header {

0 commit comments

Comments
 (0)