Ticket #5461: 5461_3.patch
File 5461_3.patch, 2.5 KB (added by , 14 years ago) |
---|
-
_source/plugins/clipboard/dialogs/paste.js
11 11 function onPasteFrameLoad( win ) 12 12 { 13 13 var doc = new CKEDITOR.dom.document( win.document ), 14 $ = doc.$; 14 docElement = doc.$, 15 selection, bookmarks; 15 16 16 17 doc.getById( "cke_actscrpt" ).remove(); 17 18 18 19 CKEDITOR.env.ie ? 19 $.body.contentEditable = "true" :20 $.designMode = "on";20 docElement.body.contentEditable = "true" : 21 docElement.designMode = "on"; 21 22 22 CKEDITOR.env.ie && doc.getWindow().on( 'blur', function() 23 // IE before version 8 will leave cursor blinking inside the document after 24 // editor blurred unless we clean up the selection. (#4716) 25 if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) 23 26 { 24 $.body.contentEditable = "false"; 25 } ); 27 doc.getWindow().on( 'blur', function() 28 { 29 docElement.selection.empty(); 30 } ); 31 } 26 32 27 33 doc.on( "keydown", function( e ) 28 34 { … … 108 114 container.setHtml( '' ); 109 115 container.append( iframe ); 110 116 117 // IE need a redirect on focus to make 118 // the cursor blinking inside iframe. (#5461) 119 if ( CKEDITOR.env.ie ) 120 { 121 var focusGrabber = CKEDITOR.dom.element.createFromHtml( '<span tabindex="-1" style="position:absolute;" role="presentation"></span>' ); 122 focusGrabber.on( 'focus', function() 123 { 124 iframe.$.contentWindow.focus(); 125 }); 126 container.append( focusGrabber ); 127 128 // Override focus handler on field. 129 field.focus = function() 130 { 131 focusGrabber.focus(); 132 this.fire( 'focus' ); 133 }; 134 } 135 111 136 field.getInputElement = function(){ return iframe; }; 112 137 113 138 // Force container to scale in IE. … … 165 190 html : '', 166 191 focus : function() 167 192 { 168 var win = this.getInputElement().$.contentWindow, 169 body = win && win.document.body; 193 var win = this.getInputElement().$.contentWindow; 170 194 171 195 // #3291 : JAWS needs the 500ms delay to detect that the editor iframe 172 196 // iframe is no longer editable. So that it will put the focus into the 173 197 // Paste from Word dialog's editable area instead. 174 198 setTimeout( function() 175 199 { 176 // Reactivate design mode for IE to make the cursor blinking.177 CKEDITOR.env.ie && body && ( body.contentEditable = "true" );178 200 win.focus(); 179 201 }, 500 ); 180 202 }