Skip to content

Commit

Permalink
Merge branch 't/10098'
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Feb 21, 2013
2 parents d360d7b + 5ab7b71 commit c335a3f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions core/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,17 @@
// Give the editable an initial selection on first focus,
// put selection at a consistent position at the start
// of the contents. (#5156)
editable.attachListener( editable, 'focus', function( evt ) {
evt.removeListener();

if ( restoreSel !== 0 ) {
var rng = editor.createRange();
rng.moveToElementEditStart( editable );
rng.select();
}
}, null, null, -2 );
if ( !CKEDITOR.env.opera ) {
editable.attachListener( editable, 'focus', function( evt ) {
evt.removeListener();

if ( restoreSel !== 0 ) {
var rng = editor.createRange();
rng.moveToElementEditStart( editable );
rng.select();
}
}, null, null, -2 );
}

// Plays the magic here to restore/save dom selection on editable focus/blur.
editable.attachListener( editable, 'focus', function() {
Expand Down

0 comments on commit c335a3f

Please sign in to comment.