Ticket #8324: 8324_2.patch
File 8324_2.patch, 1.3 KB (added by , 12 years ago) |
---|
-
_source/plugins/undo/plugin.js
407 407 this.fireChange(); 408 408 return true; 409 409 }, 410 411 restoreImage : function( image ) 412 { 413 // Bring editor focused to restore selection. 414 var editor = this.editor, 415 sel; 410 416 411 restoreImage : function( image )412 {413 this.editor.loadSnapshot( image.contents );414 415 417 if ( image.bookmarks ) 416 { 417 this.editor.focus(); 418 this.editor.getSelection().selectBookmarks( image.bookmarks ); 418 { 419 editor.focus(); 420 // Retrieve the selection beforehand. (#8324) 421 sel = editor.getSelection(); 419 422 } 420 else if ( CKEDITOR.env.ie ) 421 { 422 // IE BUG: If I don't set the selection to *somewhere* after setting 423 424 this.editor.loadSnapshot( image.contents ); 425 426 if ( image.bookmarks ) 427 sel.selectBookmarks( image.bookmarks ); 428 else if ( CKEDITOR.env.ie ) 429 { 430 // IE BUG: If I don't set the selection to *somewhere* after setting 423 431 // document contents, then IE would create an empty paragraph at the bottom 424 432 // the next time the document is modified. 425 433 var $range = this.editor.document.getBody().$.createTextRange();