Ticket #1659: 1659_9.patch

File 1659_9.patch, 1.8 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    406406                                                        } );
    407407                                                }
    408408
     409                                                // IE standard compliant in editing frame doesn't focus the editor when
     410                                                // clicking outside actual content, manually apply the focus. (#1659)
     411                                                if( CKEDITOR.env.ie
     412                                                        && domDocument.$.compatMode == 'CSS1Compat' )
     413                                                {
     414                                                        var htmlElement = domDocument.getDocumentElement();
     415                                                        htmlElement.on( 'mousedown', function( evt )
     416                                                        {
     417                                                                // Setting focus directly on editor doesn't work, we
     418                                                                // have to use here a temporary element to 'redirect'
     419                                                                // the focus.
     420                                                                if ( evt.data.getTarget().equals( htmlElement ) )
     421                                                                        ieFocusGrabber.focus();
     422                                                        } );
     423                                                }
     424
    409425                                                var focusTarget = ( CKEDITOR.env.ie || CKEDITOR.env.webkit ) ?
    410426                                                                domWindow : domDocument;
    411427
     
    633649                                        // Auto fixing on some document structure weakness to enhance usabilities. (#3190 and #3189)
    634650                                        editor.on( 'selectionChange', onSelectionChangeFixBody, null, null, 1 );
    635651                                });
    636                 }
     652
     653                        // Create an invisible element to grab focus.
     654                        if( CKEDITOR.env.ie )
     655                        {
     656                                var ieFocusGrabber;
     657                                editor.on( 'uiReady', function()
     658                                {
     659                                        ieFocusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml(
     660                                        '<input tabindex="-1" style="position:absolute; left:-10000">' ) );
     661
     662                                        ieFocusGrabber.on( 'focus', function()
     663                                                {
     664                                                        editor.focus();
     665                                                } );
     666                                } );
     667                        }
     668                }
    637669        });
    638670
    639671        // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514)
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy