Ticket #5149: 5149.patch

File 5149.patch, 1.5 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/maximize/plugin.js

     
    8787                };
    8888        }
    8989
     90        function refreshCursor( editor )
     91        {
     92                if ( editor.focusManager.hasFocus )
     93                {
     94                        var focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml(
     95                                '<span tabindex="-1" style="position:absolute; left:-10000" role="presentation"></span>' ) );
     96
     97                        focusGrabber.on( 'focus', function()
     98                                {
     99                                        editor.focus();
     100                                } );
     101                        focusGrabber.focus();
     102                        focusGrabber.remove();
     103                }
     104        }
     105
    90106        CKEDITOR.plugins.add( 'maximize',
    91107        {
    92108                init : function( editor )
     
    190206                                                                        top : ( -1 * offset.y ) + 'px'
    191207                                                                } );
    192208
     209                                                        // Fixing positioning editor chrome in Firefox break design mode. (#5149)
     210                                                        CKEDITOR.env.gecko && refreshCursor( editor );
     211
    193212                                                        // Add cke_maximized class.
    194213                                                        container.addClass( 'cke_maximized' );
    195214                                                }
     
    242261                                                {
    243262                                                        if ( savedSelection )
    244263                                                        {
     264                                                                // Fixing positioning editor chrome in Firefox break design mode. (#5149)
     265                                                                CKEDITOR.env.gecko && refreshCursor( editor );
     266
    245267                                                                editor.getSelection().selectRanges(savedSelection);
    246268                                                                var element = editor.getSelection().getStartElement();
    247269                                                                element && element.scrollIntoView( true );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy