Ticket #4073: 4073_3.patch
File 4073_3.patch, 1.9 KB (added by , 14 years ago) |
---|
-
_source/plugins/templates/dialogs/templates.js
81 81 82 82 if( isInsert ) 83 83 { 84 // Everything should happen after the document is loaded (#4073). 85 editor.on( 'contentDom', function( evt ) 86 { 87 evt.removeListener(); 88 dialog.hide(); 89 90 // Place the cursor at the first editable place. 91 var range = new CKEDITOR.dom.range( editor.document ); 92 range.moveToElementEditStart( editor.document.getBody() ); 93 range.select( true ); 94 } ); 84 95 editor.setData( html ); 85 96 } 86 97 else 87 98 { 88 99 editor.insertHtml( html ); 89 } 90 91 dialog.hide(); 92 } 100 dialog.hide(); 101 } 102 } 93 103 94 104 CKEDITOR.dialog.add( 'templates', function( editor ) 95 105 { -
_source/plugins/dialog/plugin.js
592 592 */ 593 593 show : function() 594 594 { 595 if ( this._.editor.mode == 'wysiwyg' && CKEDITOR.env.ie ) 596 this._.editor.getSelection().lock(); 595 var editor = this._.editor; 596 if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie ) 597 { 598 var selection = editor.getSelection(); 599 selection && selection.lock(); 600 } 597 601 598 602 // Insert the dialog's element to the root document. 599 603 var element = this._.element; … … 779 783 editor.focus(); 780 784 781 785 if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie ) 782 editor.getSelection().unlock( true ); 783 } 786 { 787 var selection = editor.getSelection(); 788 selection && selection.unlock( true ); 789 } 790 } 784 791 else 785 792 CKEDITOR.dialog._.currentZIndex -= 10; 786 793