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
|
'editor--options': this.props.editorOptionsVisible
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const editorHolderClass = classNames({
|
||||||
|
'editor-holder': true,
|
||||||
|
'editor-holder--hidden': this.props.file.fileType === 'folder' || this.props.file.url
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
title="code editor"
|
title="code editor"
|
||||||
|
@ -322,7 +327,7 @@ class Editor extends React.Component {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div ref={(element) => { this.codemirrorContainer = element; }} className="editor-holder" >
|
<div ref={(element) => { this.codemirrorContainer = element; }} className={editorHolderClass} >
|
||||||
</div>
|
</div>
|
||||||
<EditorAccessibility
|
<EditorAccessibility
|
||||||
lintMessages={this.props.lintMessages}
|
lintMessages={this.props.lintMessages}
|
||||||
|
@ -352,7 +357,9 @@ Editor.propTypes = {
|
||||||
file: PropTypes.shape({
|
file: PropTypes.shape({
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
content: PropTypes.string.isRequired,
|
content: PropTypes.string.isRequired,
|
||||||
id: PropTypes.string.isRequired
|
id: PropTypes.string.isRequired,
|
||||||
|
fileType: PropTypes.string.isRequired,
|
||||||
|
url: PropTypes.string.isRequired
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
editorOptionsVisible: PropTypes.bool.isRequired,
|
editorOptionsVisible: PropTypes.bool.isRequired,
|
||||||
showEditorOptions: PropTypes.func.isRequired,
|
showEditorOptions: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -328,6 +328,9 @@ pre.CodeMirror-line {
|
||||||
height: calc(100% - #{29 / $base-font-size}rem);
|
height: calc(100% - #{29 / $base-font-size}rem);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
&.editor-holder--hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor__header {
|
.editor__header {
|
||||||
|
|
Loading…
Reference in a new issue