Skip to content

Commit

Permalink
Do not scroll after inserting element on Opera, because selection may…
Browse files Browse the repository at this point in the history
… be broken.
  • Loading branch information
Reinmar committed Nov 7, 2012
1 parent 6bf421c commit 57049a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@

selection.selectRanges( [ range ] );

afterInsert( this );
// Do not scroll after inserting, because Opera may fail on certain element (e.g. iframe/iframe.html).
afterInsert( this, CKEDITOR.env.opera );
},

/**
Expand Down Expand Up @@ -1587,11 +1588,11 @@
editable.editor.fire( 'saveSnapshot' );
}

function afterInsert( editable ) {
function afterInsert( editable, noScroll ) {
var editor = editable.editor;

// Scroll using selection, not ranges, to affect native pastes.
editor.getSelection().scrollIntoView();
!noScroll && editor.getSelection().scrollIntoView();

// Save snaps after the whole execution completed.
// This's a workaround for make DOM modification's happened after
Expand Down

0 comments on commit 57049a1

Please sign in to comment.