diff --git a/CHANGES.md b/CHANGES.md index 1d0b1fde9e8..86c9902e42f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ Fixed Issues: * [#12354](http://dev.ckeditor.com/ticket/12354): Fixed: Various issues in undo manager when holding keys. * [#12402](http://dev.ckeditor.com/ticket/12402): Fixed: Workaround for Blink's bug with `document.title` which breaks updating title in the full HTML mode. * [#12338](http://dev.ckeditor.com/ticket/12338): Fixed: CKEditor package contains unoptimised images. +* [#12324](http://dev.ckeditor.com/ticket/12324): [IE8] Fixed: Undo steps not recorded when changing caret position by clicking below body. ## CKEditor 4.4.4 diff --git a/plugins/undo/plugin.js b/plugins/undo/plugin.js index 88b1cece969..3fdfaf94aa6 100644 --- a/plugins/undo/plugin.js +++ b/plugins/undo/plugin.js @@ -1041,7 +1041,8 @@ * Attaches editable listeners required to provide the undo functionality. */ attachListeners: function() { - var editable = this.undoManager.editor.editable(), + var editor = this.undoManager.editor, + editable = editor.editable(), that = this; // We'll create a snapshot here (before DOM modification), because we'll @@ -1070,7 +1071,8 @@ // Click should create a snapshot if needed, but shouldn't cause change event. // Don't pass onNavigationKey directly as a listener because it accepts one argument which // will conflict with evt passed to listener. - editable.attachListener( editable, 'click', function() { + // #12324 comment:4 + editable.attachListener( editable.isInline() ? editable : editor.document.getDocumentElement(), 'click', function() { that.onNavigationKey(); } ); diff --git a/tests/plugins/undo/_helpers/tools.js b/tests/plugins/undo/_helpers/tools.js index dd7bd08bd20..05aeb29fa1e 100644 --- a/tests/plugins/undo/_helpers/tools.js +++ b/tests/plugins/undo/_helpers/tools.js @@ -25,6 +25,8 @@ var undoEventDispatchTestsTools = function( testSuite ) { var ckEvent = new CKEDITOR.dom.event( eventProperties ); testSuite.editor.editable().fire( eventType, ckEvent ); + // Fire event on the element - pretend event's bubbling. + testSuite.editor.document.getDocumentElement().fire( eventType, ckEvent ); } };