Improve CKEditor plugin listeners logic
This commit is contained in:
parent
b8dba4bba9
commit
5ed444f577
16
service.js
16
service.js
@ -692,10 +692,10 @@ class BesCKService extends BesService {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('undo').on('execute', () => {
|
this.ckEditorInstance.commands.get('undo').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('redo').on('execute', () => {
|
this.ckEditorInstance.commands.get('redo').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('bold').on('execute', () => {
|
this.ckEditorInstance.commands.get('bold').on('execute', () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -710,16 +710,16 @@ class BesCKService extends BesService {
|
|||||||
}, 500)
|
}, 500)
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('indent').on('execute', () => {
|
this.ckEditorInstance.commands.get('indent').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('outdent').on('execute', () => {
|
this.ckEditorInstance.commands.get('outdent').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('numberedList').on('execute', () => {
|
this.ckEditorInstance.commands.get('numberedList').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
this.ckEditorInstance.commands.get('bulletedList').on('execute', () => {
|
this.ckEditorInstance.commands.get('bulletedList').on('execute', () => {
|
||||||
this.handlePluginChanges()
|
this.proofCKEditor()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -777,7 +777,7 @@ class BesCKService extends BesService {
|
|||||||
this.children = []
|
this.children = []
|
||||||
}
|
}
|
||||||
|
|
||||||
handlePluginChanges() {
|
proofCKEditor() {
|
||||||
this.clearAllMistakes(this.scrollPanel)
|
this.clearAllMistakes(this.scrollPanel)
|
||||||
this.clearChildren()
|
this.clearChildren()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -858,7 +858,7 @@ class BesCKService extends BesService {
|
|||||||
// It maintains reasonable performance as it only checks the block element that has been modified,
|
// It maintains reasonable performance as it only checks the block element that has been modified,
|
||||||
// rather than re-evaluating the entire document or a larger set of elements.
|
// rather than re-evaluating the entire document or a larger set of elements.
|
||||||
this.abortController = new AbortController()
|
this.abortController = new AbortController()
|
||||||
this.proof(el)
|
this.proofCKEditor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user