Ticket #5461: 5461_4.patch

File 5461_4.patch, 2.5 KB (added by brooks, 14 years ago)
  • _source/plugins/clipboard/dialogs/paste.js

     
    1111        function onPasteFrameLoad( win )
    1212        {
    1313                var doc =  new CKEDITOR.dom.document( win.document ),
    14                         $ = doc.$;
     14                        docElement = doc.$;
    1515
    1616                doc.getById( "cke_actscrpt" ).remove();
    1717
    1818                CKEDITOR.env.ie ?
    19                         $.body.contentEditable = "true" :
    20                         $.designMode = "on";
     19                        docElement.body.contentEditable = "true" :
     20                        docElement.designMode = "on";
    2121
    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 )
    2325                {
    24                          $.body.contentEditable = "false";
    25                 } );
     26                        doc.getWindow().on( 'blur', function()
     27                        {
     28                                docElement.selection.empty();
     29                        } );
     30                }
    2631
    2732                doc.on( "keydown", function( e )
    2833                {
     
    111116                                container = field.getElement();
    112117                        container.setHtml( '' );
    113118                        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 );
    114130
     131                                // Override focus handler on field.
     132                                field.focus = function()
     133                                {
     134                                        focusGrabber.focus();
     135                                        this.fire( 'focus' );
     136                                };
     137                        }
     138
    115139                        field.getInputElement = function(){ return iframe; };
    116140
    117141                        // Force container to scale in IE.
     
    169193                                                html : '',
    170194                                                focus : function()
    171195                                                {
    172                                                         var win = this.getInputElement().$.contentWindow,
    173                                                                  body = win && win.document.body;
     196                                                        var win = this.getInputElement().$.contentWindow;
    174197
    175198                                                        // #3291 : JAWS needs the 500ms delay to detect that the editor iframe
    176199                                                        // iframe is no longer editable. So that it will put the focus into the
    177200                                                        // Paste from Word dialog's editable area instead.
    178201                                                        setTimeout( function()
    179202                                                        {
    180                                                                 // Reactivate design mode for IE to make the cursor blinking.
    181                                                                 CKEDITOR.env.ie && body && ( body.contentEditable = "true" );
    182203                                                                win.focus();
    183204                                                        }, 500 );
    184205                                                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy