Ticket #4044: 4044.patch

File 4044.patch, 1.2 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/toolbar/plugin.js

     
    4747                                        if ( CKEDITOR.env.ie )
    4848                                                setTimeout( function(){ editor.toolbox.focus(); }, 100 );
    4949                                        else
     50                                        {
     51                                                if ( CKEDITOR.env.opera )
     52                                                        editor.toolbox.focusSwitch.focus();
     53
    5054                                                editor.toolbox.focus();
    51                                 }
    52                         }
    53                 }
     55                                        }
     56                                }
     57                        }
     58                }
    5459        };
    5560
    5661        CKEDITOR.plugins.add( 'toolbar',
     
    140145                                                return false;
    141146
    142147                                        case 27 :                                       // ESC
     148                                                if ( CKEDITOR.env.opera )
     149                                                        editor.toolbox.focusSwitch.focus();
    143150                                                editor.focus();
    144151                                                return false;
    145152
     
    345352                                        }
    346353                                });
    347354
     355                        // Opera requires an invisible input to 'redirect' the focus when
     356                        // switching focus from toolbar to editor (#4044).
     357                        if ( CKEDITOR.env.opera )
     358                        {
     359                                editor.on( 'uiReady', function()
     360                                {
     361                                        editor.toolbox.focusSwitch = editor.container.append( CKEDITOR.dom.element.createFromHtml(
     362                                                '<input tabindex="-1" style="position:absolute;width:1px;height:0px" role="presentation" />' ) );
     363                                } );
     364                        }
     365
    348366                        editor.addCommand( 'toolbarFocus', commands.toolbarFocus );
    349367                }
    350368        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy