mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Fix bug on UI Tab in relation to React CodeMirror
This commit is contained in:
@@ -25,6 +25,7 @@ class UiTab extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
CodeMirror.autoLoadMode(this.codeMirrorInstance.getCodeMirror(), 'javascript')
|
||||||
this.handleSettingDone = () => {
|
this.handleSettingDone = () => {
|
||||||
this.setState({UiAlert: {
|
this.setState({UiAlert: {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
@@ -41,10 +42,6 @@ class UiTab extends React.Component {
|
|||||||
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
|
ipc.addListener('APP_SETTING_ERROR', this.handleSettingError)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount () {
|
|
||||||
CodeMirror.autoLoadMode(ReactCodeMirror, 'javascript')
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
ipc.removeListener('APP_SETTING_DONE', this.handleSettingDone)
|
ipc.removeListener('APP_SETTING_DONE', this.handleSettingDone)
|
||||||
ipc.removeListener('APP_SETTING_ERROR', this.handleSettingError)
|
ipc.removeListener('APP_SETTING_ERROR', this.handleSettingError)
|
||||||
@@ -191,7 +188,7 @@ class UiTab extends React.Component {
|
|||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<div styleName='code-mirror'>
|
<div styleName='code-mirror'>
|
||||||
<ReactCodeMirror value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
|
<ReactCodeMirror ref={e => this.codeMirrorInstance = e} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user