fix isEditable

This commit is contained in:
Philipp Kühn
2020-08-21 22:08:54 +02:00
parent 65ed653d22
commit be6ee9853c
2 changed files with 8 additions and 6 deletions

View File

@@ -49,6 +49,7 @@ export class Editor extends EventEmitter {
public schema!: Schema
public view!: EditorView
public selection = { from: 0, to: 0 }
public isFocused = false
public options: EditorOptions = {
element: document.createElement('div'),
content: '',
@@ -57,8 +58,6 @@ export class Editor extends EventEmitter {
autoFocus: false,
editable: true,
}
public isFocused = false
public isEditable = true
constructor(options: Partial<EditorOptions> = {}) {
super()
@@ -98,6 +97,10 @@ export class Editor extends EventEmitter {
}
}
public get isEditable() {
return this.view && this.view.editable
}
public get state() {
return this.view.state
}