Opened 5 years ago

Closed 5 years ago

#12108 closed Bug (invalid)

saveSnapshot does not enable the Undo button in toolbar

Reported by: scott Owned by:
Priority: Normal Milestone:
Component: Core : Undo & Redo Version:
Keywords: Cc:

Description

This can be duplicated on the CKEditor demo site using the standard editor option. After the editor is initially displayed (at the JS console) i issue the following commands. I'm using the latest version of Chrome on a Macbook Pro OSX 10.9.3

insure the snapshot stack is empty with this command: CKEDITOR.instances.editor3.undoManager.snapshots

Then I fire a saveSnapshot command like this: CKEDITOR.instances.editor3.fire('saveSnapshot')

This will actually create a snapshot on the snapshot stack, however, the Undo button will NOT enable allowing for an undo. Is this the correct behavior or an bug? I'm trying to save a snapshot before executing a custom plugin that I have written that removes content from the editor.

As a side not, if the undo/redo buttons are already enabled, clicking undo works as expected.

Any help or advice is greatly appreciated.

Change History (1)

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

Resolution: invalid
Status: newclosed
Version: 4.4.1

That's because undo needs to snapshots to be activated, because editor must see a difference between states. One snapshot does not inform undo manager to which state it could undo.

I don't know if it helps, but most important fact about saveSnapshot is that it has to be fired twice by features that change something - before the change and after. See that editor features does this.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy