Ticket #6192: 6192_3.patch

File 6192_3.patch, 1.1 KB (added by Tobiasz Cudnik, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    616616                                                                editor.focusManager.blur();
    617617                                                        });
    618618
     619                                                var wasFocused;
     620
    619621                                                domWindow.on( 'focus', function()
    620622                                                        {
    621623                                                                var doc = editor.document;
     
    624626                                                                        blinkCursor();
    625627                                                                else if ( CKEDITOR.env.opera )
    626628                                                                        doc.getBody().focus();
     629                                                                else if ( CKEDITOR.env.webkit )
     630                                                                {
     631                                                                        if ( !wasFocused )
     632                                                                        {
     633                                                                                editor.document.getDocumentElement().focus();
     634                                                                                wasFocused = 1;
    627635
     636                                                                                // Webkit does not scroll to the cursor position after first focus (#6192)
     637                                                                                setTimeout(function()
     638                                                                                {
     639                                                                                        doc.$.execCommand( 'inserthtml', false, '<span id="cke_focus_marker" cke_temp="1"></span>' );
     640                                                                                        var marker = doc.getById( 'cke_focus_marker' );
     641                                                                                        marker.scrollIntoView();
     642                                                                                        marker.remove();
     643                                                                                }, 0 );
     644                                                                        }
     645                                                                }
     646
    628647                                                                editor.focusManager.focus();
    629648                                                        });
    630649
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy