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. |
| `getJSON` | | Get the current content as JSON. |
| `getHTML` | | Get the current content as HTML. |
| `focus` | — | Focus the editor |
| `destroy` | | Destroys the editor. |
| `focus` | | Focus the editor. |
| `blur` | | Blur the editor. |
| `destroy` | | Destroy the editor. |
## Components

View File

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