File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,11 @@ class Editor extends React.Component {
290
290
'editor--options' : this . props . editorOptionsVisible
291
291
} ) ;
292
292
293
+ const editorHolderClass = classNames ( {
294
+ 'editor-holder' : true ,
295
+ 'editor-holder--hidden' : this . props . file . fileType === 'folder' || this . props . file . url
296
+ } ) ;
297
+
293
298
return (
294
299
< section
295
300
title = "code editor"
@@ -322,7 +327,7 @@ class Editor extends React.Component {
322
327
/>
323
328
</ div >
324
329
</ header >
325
- < div ref = { ( element ) => { this . codemirrorContainer = element ; } } className = "editor-holder" >
330
+ < div ref = { ( element ) => { this . codemirrorContainer = element ; } } className = { editorHolderClass } >
326
331
</ div >
327
332
< EditorAccessibility
328
333
lintMessages = { this . props . lintMessages }
@@ -352,7 +357,9 @@ Editor.propTypes = {
352
357
file : PropTypes . shape ( {
353
358
name : PropTypes . string . isRequired ,
354
359
content : PropTypes . string . isRequired ,
355
- id : PropTypes . string . isRequired
360
+ id : PropTypes . string . isRequired ,
361
+ fileType : PropTypes . string . isRequired ,
362
+ url : PropTypes . string . isRequired
356
363
} ) . isRequired ,
357
364
editorOptionsVisible : PropTypes . bool . isRequired ,
358
365
showEditorOptions : PropTypes . func . isRequired ,
Original file line number Diff line number Diff line change @@ -328,6 +328,9 @@ pre.CodeMirror-line {
328
328
height : calc (100% - #{29 / $base-font-size } rem );
329
329
width : 100% ;
330
330
position : absolute ;
331
+ & .editor-holder--hidden {
332
+ display : none ;
333
+ }
331
334
}
332
335
333
336
.editor__header {
You can’t perform that action at this time.
0 commit comments