Skip to content

Commit

Permalink
Merge branch 't/11839'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed May 1, 2014
2 parents 53f341e + be0cfb4 commit 0e78956
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -13,6 +13,7 @@ Fixed Issues:
* [#11872](http://dev.ckeditor.com/ticket/11872): Made [`element.addClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass) chainable symmetrically to [`element.removeClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass).
* [#11813](http://dev.ckeditor.com/ticket/11813): Fixed: Link lost while pasting captioned image and restoring undo snapshot ([Enhanced Image](http://ckeditor.com/addon/image2)).
* [#11814](http://dev.ckeditor.com/ticket/11814): Fixed: _Link_ and _Unlink_ entries persistently displayed in [Enhanced Image](http://ckeditor.com/addon/image2) context menu.
* [#11839](http://dev.ckeditor.com/ticket/11839): Fixed: [IE9] Caret jumps out of editable when resizing editor in source mode.

Other changes:

Expand Down
9 changes: 9 additions & 0 deletions plugins/sourcearea/plugin.js
Expand Up @@ -77,14 +77,23 @@
editor.getCommand( 'source' ).setState( editor.mode == 'source' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );
} );

var needsFocusHack = CKEDITOR.env.ie && CKEDITOR.env.version == 9;

function onResize() {
// We have to do something with focus on IE9, because if sourcearea had focus
// before being resized, the caret ends somewhere in the editor UI (#11839).
var wasActive = needsFocusHack && this.equals( CKEDITOR.document.getActive() );

// Holder rectange size is stretched by textarea,
// so hide it just for a moment.
this.hide();
this.setStyle( 'height', this.getParent().$.clientHeight + 'px' );
this.setStyle( 'width', this.getParent().$.clientWidth + 'px' );
// When we have proper holder size, show textarea again.
this.show();

if ( wasActive )
this.focus();
}
}
} );
Expand Down

0 comments on commit 0e78956

Please sign in to comment.