Ticket #4682: 4682_3.patch

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

Revised patch

  • _source/plugins/selection/plugin.js

     
    120120                                                // "onfocusin" is fired before "onfocus". It makes it
    121121                                                // possible to restore the selection before click
    122122                                                // events get executed.
    123                                                 body.on( 'focusin', function()
     123                                                body.on( 'focusin', function( evt )
    124124                                                        {
     125                                                                // If there are elements with layout they fire this event but
     126                                                                // it must be ignored to allow edit its contents #4682
     127                                                                if ( evt.data.$.srcElement.nodeName != 'BODY' )
     128                                                                        return;
     129
    125130                                                                // If we have saved a range, restore it at this
    126131                                                                // point.
    127132                                                                if ( savedRange )
     
    146151                                                                saveSelection();
    147152                                                        });
    148153
    149                                                 body.on( 'beforedeactivate', function()
     154                                                body.on( 'beforedeactivate', function( evt )
    150155                                                        {
     156                                                                // Ignore this event if it's caused by focus switch between
     157                                                                // internal editable control type elements, e.g. layouted paragraph. (#4682)
     158                                                                if ( evt.data.$.toElement )
     159                                                                        return;
     160
    151161                                                                // Disable selections from being saved.
    152162                                                                saveEnabled = false;
    153163                                                        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy