add can method to editor class

This commit is contained in:
Philipp Kühn
2020-11-02 17:18:12 +01:00
parent c73b03c595
commit 7bfab4685f
2 changed files with 35 additions and 15 deletions

View File

@@ -115,7 +115,6 @@ export class Editor extends EventEmitter {
this.createExtensionManager()
this.createSchema()
this.createView()
// this.registerCommands(coreCommands)
this.injectCSS()
window.setTimeout(() => this.proxy.focus(this.options.autoFocus), 0)
@@ -138,6 +137,13 @@ export class Editor extends EventEmitter {
return this.commandManager.createChain()
}
/**
* Check if a command or a command chain can be executed. Without executing it.
*/
public can() {
return this.commandManager.createCan()
}
/**
* Inject CSS styles.
*/