Reputation: 645
I'm setting up a ckeditor instance and listen to the editor.on("change")
event to get notified of changes.
Is there a way, whenever something changes in the document, either a added character or changed markup, to receive an event and from there find out the part that has changed?
Inspecting the data sent with the "change" event didn't give me the desired results, it doesn't seem to contain the added changes.
I know there's the "key" event, that sends me the keycode typed, is there something else for changed markup (like when clicking on the "bold" button?
Or is there another way intirely?
Thanks for your help!
Upvotes: 1
Views: 210
Reputation: 12690
The "change" event fired by CKEditor is quite dumb and won't give you what you want.
You'll have to ignore it and get your hands dirty using MutationObservers on the DOM that will give you so much info that your first problem will be how to handle all of that, how to ignore internal CKEditor changes, etc...
Upvotes: 1