Skip to content
Permalink
Browse files

Merge branch 't/10119'

  • Loading branch information...
Reinmar committed Feb 26, 2013
2 parents c335a3f + 7afa822 commit a2136ce88507a12d72f00294210d2be7b22e6dd9
Showing with 15 additions and 4 deletions.
  1. +11 −3 core/selection.js
  2. +4 −1 plugins/elementspath/plugin.js
@@ -206,9 +206,17 @@
evt.removeListener();

if ( restoreSel !== 0 ) {
var rng = editor.createRange();
rng.moveToElementEditStart( editable );
rng.select();
var native = editor.getSelection().getNative();
// Do it only if the native selection is at an unwanted
// place (at the very start of the editable). #10119
// IEs<9 won't enter this if (no isCollapsed property on selection instance),
// but this is acceptable since they do a good job in terms of
// default selection positioning.
if ( native.isCollapsed && native.anchorNode == editable.$ ) {
var rng = editor.createRange();
rng.moveToElementEditStart( editable );
rng.select();
}
}
}, null, null, -2 );
}
@@ -88,14 +88,17 @@


function onClick( elementIndex ) {
editor.focus();
var element = editor._.elementsPath.list[ elementIndex ];
if ( element.equals( editor.editable() ) ) {
var range = editor.createRange();
range.selectNodeContents( element );
range.select();
} else
editor.getSelection().selectElement( element );

// It is important to focus() *after* the above selection
// manipulation, otherwise Firefox will have troubles. #10119
editor.focus();
}

var onClickHanlder = CKEDITOR.tools.addFunction( onClick );

0 comments on commit a2136ce

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.