Skip to content

Commit

Permalink
Adds documentation for willCopy 🎀
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeJab committed May 22, 2020
1 parent f5f0cb8 commit be4324e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,14 @@ The available lifecycle hooks are:
movement or clicking in the document.
* `editor.onTextInput()` - When the user adds text to the document (see [example](https://github.com/bustlelabs/mobiledoc-kit#responding-to-text-input))
* `editor.inputModeDidChange()` - The active section(s) or markup(s) at the current cursor position or selection have changed. This hook can be used with `Editor#activeMarkups`, `Editor#activeSections`, and `Editor#activeSectionAttributes` to implement a custom toolbar.
* `editor.beforeToggleMarkup(({markup, range, willAdd} => {...})` - Register a
* `editor.beforeToggleMarkup(({markup, range, willAdd}) => {...})` - Register a
callback that will be called before `editor#toggleMarkup` is applied. If any
callback returns literal `false`, the toggling of markup will be canceled.
(Toggling markup done via the postEditor, e.g. `editor.run(postEditor =>
postEditor.toggleMarkup(...))` will skip this callback.
* `editor.willCopy(({html, text, mobiledoc}) => {...})` - Called before the
serialized versions of the selected markup is copied to the system
pasteboard.

For more details on the lifecycle hooks, see the [Editor documentation](https://bustle.github.io/mobiledoc-kit/demo/docs/Editor.html).

Expand Down

0 comments on commit be4324e

Please sign in to comment.