Ticket #4682: 4682.patch

File 4682.patch, 1.6 KB (added by Alfonso Martínez de Lizarrondo, 14 years ago)

Proposed patch

  • _source/plugins/selection/plugin.js

     
    108108                                                // "onfocusin" is fired before "onfocus". It makes it
    109109                                                // possible to restore the selection before click
    110110                                                // events get executed.
    111                                                 body.on( 'focusin', function()
     111                                                body.on( 'focusin', function(evt)
    112112                                                        {
     113                                                                // If there are elements with layout they fire this event but
     114                                                                // it must be ignored to allow edit its contents #4682
     115                                                                if ( evt.data.$.srcElement.nodeName !== 'BODY' )
     116                                                                        return;
     117
    113118                                                                // If we have saved a range, restore it at this
    114119                                                                // point.
    115120                                                                if ( savedRange )
     
    143148                                                                // editor blurred unless we clean up the selection. (#4716)
    144149                                                                if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 )
    145150                                                                {
    146                                                                         // IE stack overflows when we're doing so inside table. (#5114)   
     151                                                                        // IE stack overflows when we're doing so inside table. (#5114)
     152                                                                        // or an element with layout #4682
    147153                                                                        var parent =
    148154                                                                                savedRange
    149155                                                                                && savedRange.parentElement
    150156                                                                                && savedRange.parentElement();
    151157
    152                                                                         if( !( parent && parent.tagName.toLowerCase() in CKEDITOR.dtd.$tableContent ) )
     158                                                                        if( !( parent && (parent.tagName.toLowerCase() in CKEDITOR.dtd.$tableContent || parent.currentStyle.hasLayout) ) )
    153159                                                                                editor.document.$.selection.empty();
    154160                                                                }
    155161                                                        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy