add all events to extensions

This commit is contained in:
Philipp Kühn
2020-11-30 14:12:36 +01:00
parent 1ceb54bc19
commit f6206b3df5
4 changed files with 255 additions and 3 deletions

View File

@@ -34,6 +34,30 @@ export default class ExtensionManager {
editor.registerCommands(commands)
if (typeof extension.config.onCreate === 'function') {
this.editor.on('create', extension.config.onCreate.bind(context))
}
if (typeof extension.config.onUpdate === 'function') {
this.editor.on('update', extension.config.onUpdate.bind(context))
}
if (typeof extension.config.onSelection === 'function') {
this.editor.on('selection', extension.config.onSelection.bind(context))
}
if (typeof extension.config.onTransaction === 'function') {
this.editor.on('transaction', extension.config.onTransaction.bind(context))
}
if (typeof extension.config.onFocus === 'function') {
this.editor.on('focus', extension.config.onFocus.bind(context))
}
if (typeof extension.config.onBlur === 'function') {
this.editor.on('blur', extension.config.onBlur.bind(context))
}
if (typeof extension.config.onDestroy === 'function') {
this.editor.on('destroy', extension.config.onDestroy.bind(context))
}