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