Opened 10 years ago

Closed 10 years ago

#11740 closed Bug (fixed)

editor.insertHtml isn't registered as event.editor.on "change"

Reported by: Roberto Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Maybe is a bug.

I'm using a tiny scroller bar in my page (inline editor) and I must re-init the bar after every change in the editor.

event.editor.on "change", -> window.adminjsmain.jScrollPaneReinit()

Everything is working right while I'm typing text in the editor, but if I use "editor.insertHtml" the editor state is not changed.

Change History (1)

comment:1 Changed 10 years ago by Piotrek Koszuliński

Resolution: fixed
Status: newclosed
Version: 4.3.4

When you use editor.insertHtml you also have to remember about integration with undo manager - so you should fire editor#saveSnapshot events before and after the action. The editor.insertHtml method cannot do that because it does not know when is the correct moment - there are some actions which consist of more than one step.

The editor#change event is triggered by the undo manager. So if you'll fix your code integration with undo manager, then it will be correctly fired.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy