@@ -3,6 +3,7 @@ import { connect } from 'react-redux';
33import { bindActionCreators } from 'redux' ;
44import { withRouter } from 'react-router' ;
55import { HotKeys } from 'react-hotkeys' ;
6+ import DocumentTitle from 'react-document-title' ;
67import DataGUI from '../MetaFields' ;
78import Editor from '../../components/Editor' ;
89import Errors from '../../components/Errors' ;
@@ -71,44 +72,46 @@ export class Configuration extends Component {
7172 } ;
7273
7374 return (
74- < HotKeys handlers = { keyboardHandlers } className = "single" >
75- { errors && errors . length > 0 && < Errors errors = { errors } /> }
76- < div className = "content-header" >
77- < h1 > Configuration</ h1 >
78- < div className = "page-buttons multiple" >
79- < Button // TODO: Hide toggle for non-YAML config files (e.g. '_config.toml')
80- onClick = { this . toggleView }
81- type = "view-toggle"
82- active = { true }
83- triggered = { this . state . guiView }
84- block />
85- < Button
86- onClick = { this . handleClickSave }
87- type = "save"
88- active = { editorChanged || fieldChanged }
89- triggered = { updated }
90- block />
75+ < DocumentTitle title = "Configuration" >
76+ < HotKeys handlers = { keyboardHandlers } className = "single" >
77+ { errors && errors . length > 0 && < Errors errors = { errors } /> }
78+ < div className = "content-header" >
79+ < h1 > Configuration</ h1 >
80+ < div className = "page-buttons multiple" >
81+ < Button // TODO: Hide toggle for non-YAML config files (e.g. '_config.toml')
82+ onClick = { this . toggleView }
83+ type = "view-toggle"
84+ active = { true }
85+ triggered = { this . state . guiView }
86+ block />
87+ < Button
88+ onClick = { this . handleClickSave }
89+ type = "save"
90+ active = { editorChanged || fieldChanged }
91+ triggered = { updated }
92+ block />
93+ </ div >
9194 </ div >
92- </ div >
93- {
94- this . state . guiView && content &&
95- < div className = "content-body" >
96- < div className = "warning" >
97- CAUTION! Any existing comments and formatting will be lost when editing via this view.
98- Switch to the < strong > Raw Editor</ strong > to preserve comments and formatting.
95+ {
96+ this . state . guiView && content &&
97+ < div className = "content-body" >
98+ < div className = "warning" >
99+ CAUTION! Any existing comments and formatting will be lost when editing via this view.
100+ Switch to the < strong > Raw Editor</ strong > to preserve comments and formatting.
101+ </ div >
102+ < DataGUI fields = { content } dataview />
99103 </ div >
100- < DataGUI fields = { content } dataview />
101- </ div >
104+ }
105+ {
106+ ! this . state . guiView && raw_content &&
107+ < Editor
108+ editorChanged = { editorChanged }
109+ onEditorChange = { onEditorChange }
110+ content = { raw_content }
111+ ref = "editor" />
102112 }
103- {
104- ! this . state . guiView && raw_content &&
105- < Editor
106- editorChanged = { editorChanged }
107- onEditorChange = { onEditorChange }
108- content = { raw_content }
109- ref = "editor" />
110- }
111- </ HotKeys >
113+ </ HotKeys >
114+ </ DocumentTitle >
112115 ) ;
113116 }
114117}
0 commit comments