Ticket #1659: 1659_8.patch

File 1659_8.patch, 2.0 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    411411                                                        } );
    412412                                                }
    413413
     414                                                // Standard compliant IE doesn't focus the editor while
     415                                                // clicking outside actual content in editing frame. (#1659)
     416                                                if( CKEDITOR.env.ie
     417                                                        && domDocument.$.compatMode == 'CSS1Compat' )
     418                                                {
     419                                                        domDocument.on( 'mousedown', function( evt )
     420                                                        {
     421                                                                var htmlElement = domDocument.getDocumentElement(),
     422                                                                        domEvent = evt.data.$,
     423                                                                        target = evt.data.getTarget(),
     424                                                                        offsetX= domEvent.offsetX,
     425                                                                        offsetY = domEvent.offsetY,
     426                                                                        docWidth = htmlElement.$.clientWidth,
     427                                                                        docHeight = htmlElement.$.clientHeight;
     428
     429                                                                // Focus the editor if:
     430                                                                // 1. Not in <body>
     431                                                                // 2. Not on scroll-bars.
     432                                                                if ( !( editor.focusManager.hasFocus
     433                                                                                || !offsetX || !offsetY
     434                                                                        || offsetX < 0 || offsetX > docWidth
     435                                                                                || offsetY > docHeight
     436                                                                                || target.getAscendant( 'body', true) ) )
     437                                                                // Avoid focus the editor directly otherwise
     438                                                                // the cursor is not blinking.
     439                                                                        editor.container.focus();
     440                                                        } );
     441                                                }
     442
    414443                                                var focusTarget = ( CKEDITOR.env.ie || CKEDITOR.env.webkit ) ?
    415444                                                                domWindow : domDocument;
    416445
  • _source/plugins/selection/plugin.js

     
    107107                                                // "onfocusin" is fired before "onfocus". It makes it
    108108                                                // possible to restore the selection before click
    109109                                                // events get executed.
    110                                                 doc.on( 'focusin', function()
     110                                                doc.getBody().on( 'focusin', function()
    111111                                                        {
    112112                                                                // If we have saved a range, restore it at this
    113113                                                                // point.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy