Skip to content
Permalink
Browse files

Merge branch 't/12327'

  • Loading branch information...
oleq committed Aug 19, 2014
2 parents 67f620b + 88b575f commit 1ba5105c1e43c3faae06ee98f7ca6f6b2384b5a2
Showing with 41 additions and 2 deletions.
  1. +2 −2 plugins/undo/plugin.js
  2. +39 −0 tests/plugins/undo/integrations.js
@@ -898,8 +898,8 @@
ieFunctionKeysWorkaround = CKEDITOR.env.ie && keyCode in backspaceOrDelete;

// IE: doesn't call keypress for backspace/del keys so we need to handle it manually
// with a workaround.
if ( ieFunctionKeysWorkaround ) {
// with a workaround. Also we need to be aware that lastKeydownImage might not be available (#12327).
if ( ieFunctionKeysWorkaround && this.lastKeydownImage ) {
if ( this.lastKeydownImage.equalsContent( new Image( editor, true ) ) ) {
// Content was not changed, we don't need to do anything.
return;
@@ -0,0 +1,39 @@
/* bender-tags: editor,unit */
/* bender-ckeditor-plugins: undo,image */
/* bender-include: _helpers/tools.js */

( function() {
'use strict';

bender.editor = true;

var keyCodesEnum, // keyCodesEnum will be inited in first setUp call.
tcs = {
setUp: function() {
// Inits tools used to mimic events if needed.
if ( !this.tools ) {
this.tools = undoEventDispatchTestsTools( this );
// Alias for more convenient accesss.
this.keyTools = this.tools.key;
keyCodesEnum = this.keyTools.keyCodesEnum;
}

this.undoManager = this.editor.undoManager;

// For each TC we want to reset undoManager.
this.undoManager.reset();
// Force to reset inputFired counter, as some TCs may produce leftovers.
this.undoManager.editingHandler.resetCounter();
},

// (#12327)
'test image deletion': function() {
bender.tools.selection.setWithHtml( this.editor, '<p>[<img src="%BASE_PATH%_assets/img.gif" />]Apollo 11</p>' );
this.keyTools.keyEvent( keyCodesEnum.BACKSPACE, null, true );
// TC should not cause any exception.
assert.isTrue( true );
}
};

bender.test( tcs );
} )();

0 comments on commit 1ba5105

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.