Changes between Initial Version and Version 1 of Ticket #12354, comment 5
- Timestamp:
- Aug 28, 2014, 10:22:54 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12354, comment 5
initial v1 4 4 5 5 In theory snapshot should be created here, but is that good behaviour? State of editor is like that: {{{<p>a^</p>}}} but snapshot is {{{<p>aa</p>}}}. As result we can press {{{Crtl + Z}}} and snapshot last will be restored. So I think that we shouldn't create snapshot yet but it should be created after 25 + 1 keyDown`s. And calling method {{{type}}} In {{{keyDown}}} callback make sense here because in this callback is called before any DOM modifications, so state will be saved from 25 keyDown. And everything will work fine. 6 7 Btw. {{{type}}} method was called after DOM modifications, but it saved snapshot before modifications. See [https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/undo/plugin.js#L289-L292 this], so this is another argument why it should be called in {{{keyDown}}} callback.