Skip to content
Permalink
Browse files

Merge branch 't/12300'

  • Loading branch information...
Reinmar committed Nov 5, 2014
2 parents ddffe68 + ef50930 commit 184dc7f3495ab3eab718f8031f5e522acc715188
Showing with 24 additions and 2 deletions.
  1. +1 −0 CHANGES.md
  2. +4 −2 plugins/undo/plugin.js
  3. +19 −0 tests/plugins/undo/change.js
@@ -14,6 +14,7 @@ Fixed Issues:
* [#11647](http://dev.ckeditor.com/ticket/11647): Fixed: The [`editor.blur`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-blur) event is not fired on first blur after initializing the inline editor on already focused element.
* [#12601](http://dev.ckeditor.com/ticket/12601): Fixed: [Strikethrough](http://ckeditor.com/addon/basicstyles) button tooltip spelling.
* [#12546](http://dev.ckeditor.com/ticket/12546): Fixed: Preview tab in docprops dialog is always disabled.
* [#12300](http://dev.ckeditor.com/ticket/12300): Fixed: The [`editor.change`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-change) event fired on first navigation key press after typing.

Other Changes:
* [#12550](http://dev.ckeditor.com/ticket/12550): Added CKEDITOR.dtd.main.
@@ -343,7 +343,7 @@
*
* @param {Boolean} onContentOnly If set to `true`, the snapshot will be saved only if the content has changed.
* @param {CKEDITOR.plugins.undo.Image} image An optional image to save. If skipped, current editor will be used.
* @param {Boolean} autoFireChange If set to `false`, will not trigger the {@link CKEDITOR.editor#change} event to editor.
* @param {Boolean} [autoFireChange=true] If set to `false`, will not trigger the {@link CKEDITOR.editor#change} event to editor.
*/
save: function( onContentOnly, image, autoFireChange ) {
var editor = this.editor;
@@ -946,7 +946,9 @@
if ( UndoManager.isNavigationKey( keyCode ) || this.undoManager.keyGroupChanged( keyCode ) ) {
if ( undoManager.strokesRecorded[ 0 ] || undoManager.strokesRecorded[ 1 ] ) {
// We already have image, so we'd like to reuse it.
undoManager.save( false, this.lastKeydownImage );

// #12300
undoManager.save( false, this.lastKeydownImage, false );
undoManager.resetType();
}
}
@@ -161,6 +161,25 @@
} );
textNode.setText( 'foo' );
} );
},

// #12300
'test change event not fired after navigation key': function() {
this.editorBot.setHtmlWithSelection( '<p>foo^</p>' );

var textNode = this.editor.editable().getFirst().getFirst(),
keyTools = this.keyTools,
keyCodesEnum = keyTools.keyCodesEnum;

this.checkChange( function() {
keyTools.keyEvent( keyCodesEnum.KEY_D, null, null, function() {
// Textnode change required by IE.
textNode.setText( 'food' );
} );

// After setting text - caret is moved to beginning. We don't care - it does not change nothing.
keyTools.keyEvent( keyCodesEnum.LEFT, null, true );
} );
}
} );

0 comments on commit 184dc7f

Please sign in to comment.
You can’t perform that action at this time.