mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-28 17:20:13 +02:00
Merge pull request #545 from nhogle/fix-544-gutter-errors
Fix showErrors() method of CodeEditor component
This commit is contained in:
@@ -187,8 +187,9 @@ export default class CodeEditor extends Component {
|
||||
|
||||
showErrors(errors) {
|
||||
if (this.props.type === 'codemirror') {
|
||||
const editor = this.instance;
|
||||
errors.forEach(function (error) {
|
||||
this.instance.operation(function() {
|
||||
editor.operation(function () {
|
||||
var n = document.createElement('div');
|
||||
n.setAttribute('data-title', error.message);
|
||||
n.classList.add('gutter-error-marker');
|
||||
@@ -235,11 +236,11 @@ export default class CodeEditor extends Component {
|
||||
if (!monacoDepsDeferred) {
|
||||
monacoDepsDeferred = deferred();
|
||||
loadCss({ url: 'lib/monaco/monaco.css', id: 'monaco-css' });
|
||||
import(/* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js').then(
|
||||
() => {
|
||||
import(
|
||||
/* webpackChunkName: "monaco" */ '../lib/monaco/monaco.bundle.js'
|
||||
).then(() => {
|
||||
monacoDepsDeferred.resolve();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
return monacoDepsDeferred.promise;
|
||||
}
|
||||
|
Reference in New Issue
Block a user