add blur function, fix #196

This commit is contained in:
Philipp Kühn 2019-02-12 22:22:56 +01:00
parent 4e4c2dd0b9
commit c63b9aafc9
2 changed files with 7 additions and 2 deletions

View File

@ -87,8 +87,9 @@ export default {
| `registerPlugin` | `plugin` | Register a Prosemirror plugin. | | `registerPlugin` | `plugin` | Register a Prosemirror plugin. |
| `getJSON` | | Get the current content as JSON. | | `getJSON` | | Get the current content as JSON. |
| `getHTML` | | Get the current content as HTML. | | `getHTML` | | Get the current content as HTML. |
| `focus` | — | Focus the editor | | `focus` | | Focus the editor. |
| `destroy` | | Destroys the editor. | | `blur` | | Blur the editor. |
| `destroy` | | Destroy the editor. |
## Components ## Components

View File

@ -298,6 +298,10 @@ export default class Editor {
this.view.focus() this.view.focus()
} }
blur() {
this.view.dom.blur()
}
getHTML() { getHTML() {
const div = document.createElement('div') const div = document.createElement('div')
const fragment = DOMSerializer const fragment = DOMSerializer