From 47ee8b8ce73af0e20acae26324c72cde22159901 Mon Sep 17 00:00:00 2001 From: Paul Rosset Date: Fri, 1 Dec 2017 16:56:43 +0000 Subject: [PATCH 1/4] Fix bug on UI Tab in relation to React CodeMirror --- browser/main/modals/PreferencesModal/UiTab.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index eebb2e0c3..80147158f 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -25,6 +25,7 @@ class UiTab extends React.Component { } componentDidMount () { + CodeMirror.autoLoadMode(this.codeMirrorInstance.getCodeMirror(), 'javascript') this.handleSettingDone = () => { this.setState({UiAlert: { type: 'success', @@ -41,10 +42,6 @@ class UiTab extends React.Component { ipc.addListener('APP_SETTING_ERROR', this.handleSettingError) } - componentWillMount () { - CodeMirror.autoLoadMode(ReactCodeMirror, 'javascript') - } - componentWillUnmount () { ipc.removeListener('APP_SETTING_DONE', this.handleSettingDone) ipc.removeListener('APP_SETTING_ERROR', this.handleSettingError) @@ -191,7 +188,7 @@ class UiTab extends React.Component { }
- + this.codeMirrorInstance = e} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
From c64a5e1ccab3abe5074566f9fb02c26ad78ac1ec Mon Sep 17 00:00:00 2001 From: Paul Rosset Date: Fri, 1 Dec 2017 17:10:04 +0000 Subject: [PATCH 2/4] Correction eslint purpose --- browser/main/modals/PreferencesModal/UiTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 80147158f..44ae7f367 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -188,7 +188,7 @@ class UiTab extends React.Component { }
- this.codeMirrorInstance = e} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} /> + (this.codeMirrorInstance = e)} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
From cba351945880c623d4ade157bbbba7091bfbd505 Mon Sep 17 00:00:00 2001 From: Paul Rosset Date: Fri, 1 Dec 2017 17:19:21 +0000 Subject: [PATCH 3/4] Fix --- browser/main/modals/PreferencesModal/UiTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index 44ae7f367..e72d2eb82 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -188,7 +188,7 @@ class UiTab extends React.Component { }
- (this.codeMirrorInstance = e)} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} /> + (this.codeMirrorInstance = inst)} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />
From 4735992835b20665108edd140339372f1d84664e Mon Sep 17 00:00:00 2001 From: Paul Rosset Date: Fri, 1 Dec 2017 17:24:28 +0000 Subject: [PATCH 4/4] Fix --- browser/main/modals/PreferencesModal/UiTab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index e72d2eb82..44ae7f367 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -188,7 +188,7 @@ class UiTab extends React.Component { }
- (this.codeMirrorInstance = inst)} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} /> + (this.codeMirrorInstance = e)} value={codemirrorSampleCode} options={{ lineNumbers: true, readOnly: true, mode: 'javascript', theme: codemirrorTheme }} />