Opened 16 years ago
Closed 16 years ago
#3662 closed Bug (fixed)
There needs to be a way to reset the undo stack
Reported by: | Damian | Owned by: | Artur Formella |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | IBM Confirmed Review+ Doc | Cc: |
Description
A mechanism is required to reset the undo buffer.
When the editor is created with an initial set of data it is desirable to reset the undo buffer so that the user does not undo the initial setData() result.
Attachments (5)
Change History (16)
comment:1 Changed 16 years ago by
Keywords: | Confirmed added |
---|---|
Owner: | set to Artur Formella |
Status: | new → assigned |
Changed 16 years ago by
Attachment: | 3662.patch added |
---|
Changed 16 years ago by
Attachment: | 3662_testcase.patch added |
---|
comment:2 Changed 16 years ago by
Keywords: | Review? added |
---|
comment:3 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
Changed 16 years ago by
Attachment: | 3662_2.patch added |
---|
Changed 16 years ago by
Attachment: | 3662_2_testcase.patch added |
---|
comment:4 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|
comment:5 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
Sorry... but why having the function calling the event. At this point, we can simply have the function in editor doing the entire job.
comment:6 Changed 16 years ago by
Besides, certain fields are missed from resetting, and they're important to the undo system consistency:
- hasUndo
- hasRedo
- typing
Changed 16 years ago by
Attachment: | 3662_3.patch added |
---|
comment:7 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|
comment:8 follow-up: 9 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
The patch looks good, but there's one typo in it.
Please correct the typo in L305 "tasRedo" before committing.
comment:9 Changed 16 years ago by
comment:10 Changed 16 years ago by
Keywords: | Doc? added |
---|
editor.resetUndo() was introduced with this ticket.
comment:11 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The reset mechanism works.
Since the reset mechanism will be used by external developers, it's better to give them an API call instead of requiring them to fire an editor event.
So I would recommend in addition to the reset event, add a simple function under CKEDITOR.editor which would fire that event.
Also, the "History" in the resetUndoHistory event name should be redundant - resetUndo would mean essentially the same thing.