Merge pull request #658 from BrianHung/RegisterPluginPriority
Change registerPlugin to add plugin after Extensions plugins
This commit is contained in:
@@ -498,14 +498,10 @@ export default class Editor extends Emitter {
|
||||
}), {})
|
||||
}
|
||||
|
||||
registerPlugin(plugin = null) {
|
||||
if (!plugin) {
|
||||
return
|
||||
}
|
||||
|
||||
const newState = this.state.reconfigure({
|
||||
plugins: this.state.plugins.concat([plugin]),
|
||||
})
|
||||
registerPlugin(plugin = null, handlePlugins) {
|
||||
const plugins = typeof handlePlugins === 'function'
|
||||
? handlePlugins(plugin, this.state.plugins) : [...plugin, this.state.plugins]
|
||||
const newState = this.state.reconfigure({ plugins })
|
||||
this.view.updateState(newState)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user