editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Adding Event Listeners

Open ageddesi opened this issue 6 years ago • 4 comments

Hi everyone, please let me know if this already exists otherwise I may do a pull request to add the functionality.

In order to use this editor as a multi collaboration tool I need to use block interactions as transactions. To facilitate this I need to listen for events from the editor that do the following.

removeOp - When a block has been removed from the editor moveOp - When a block has been moved in the editor insertOp - When a block has been inserted. replaceOp - When a block changes its type editOp - When a block has been edited.

What do you think

ageddesi avatar Jul 30 '20 13:07 ageddesi

Would be great

CavalcanteLeo avatar Nov 28 '20 04:11 CavalcanteLeo

that good!

milu2003 avatar Mar 16 '21 06:03 milu2003

Have you implemented this functionality? I guess it would be useful for other developers and for tasks like #1780.

WowItsDoge avatar Oct 23 '21 19:10 WowItsDoge

Resolved by #1791 in 2.23.0


The editor's onChange callback now accepts CustomEvent describing what happened with block.

This CustomEvent has:

type — mutation type (Added, Removed, Moved, Changed) details.block — changed Block API details.* — additional data

neSpecc avatar Dec 15 '21 10:12 neSpecc