Commit c3d5550f authored by yann300's avatar yann300

fix registering 'contentChanged' event

parent 3ebf248c
...@@ -158,11 +158,11 @@ export const CompilerApiMixin = (Base) => class extends Base { ...@@ -158,11 +158,11 @@ export const CompilerApiMixin = (Base) => class extends Base {
} }
listenToEvents () { listenToEvents () {
this.data.eventHandlers.onContentChanged = () => { this.on('editor', 'contentChanged', () => {
this.emit('statusChanged', { key: 'edited', title: 'the content has changed, needs recompilation', type: 'info' }) this.emit('statusChanged', { key: 'edited', title: 'the content has changed, needs recompilation', type: 'info' })
} if (this.onContentChanged) this.onContentChanged()
this.on('editor', 'contentChanged', this.data.eventHandlers.onContentChanged) })
this.data.eventHandlers.onLoadingCompiler = () => { this.data.eventHandlers.onLoadingCompiler = () => {
this.data.loading = true this.data.loading = true
this.emit('statusChanged', { key: 'loading', title: 'loading compiler...', type: 'info' }) this.emit('statusChanged', { key: 'loading', title: 'loading compiler...', type: 'info' })
...@@ -195,11 +195,7 @@ export const CompilerApiMixin = (Base) => class extends Base { ...@@ -195,11 +195,7 @@ export const CompilerApiMixin = (Base) => class extends Base {
this.on('editor', 'sessionSwitched', () => { this.on('editor', 'sessionSwitched', () => {
if (this.onSessionSwitched) this.onSessionSwitched() if (this.onSessionSwitched) this.onSessionSwitched()
}) })
this.on('editor', 'contentChanged', () => {
if (this.onContentChanged) this.onContentChanged()
})
this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation) this.compileTabLogic.event.on('startingCompilation', this.data.eventHandlers.onStartingCompilation)
this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations) this.compileTabLogic.event.on('removeAnnotations', this.data.eventHandlers.onRemoveAnnotations)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment