parent
edcd225b9d
commit
38e5022661
2 changed files with 12 additions and 2 deletions
|
@ -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"
|
||||
|
@ -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}
|
||||
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue