Ticket #4736: 4736.patch

File 4736.patch, 2.0 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    449449                                                if ( keystrokeHandler )
    450450                                                        keystrokeHandler.attach( domDocument );
    451451
    452                                                 // Cancel default action for backspace in IE on control types. (#4047)
    453452                                                if ( CKEDITOR.env.ie )
    454453                                                {
     454                                                        // Cancel default action for backspace in IE on control types. (#4047)
    455455                                                        editor.on( 'key', function( event )
    456456                                                        {
    457457                                                                if( editor.mode != 'wysiwyg' )
     
    470470                                                                        event.cancel();
    471471                                                                }
    472472                                                        } );
    473                                                 }
     473
     474                                                        // PageUp/PageDown scrolling is broken in document
     475                                                        // with standard doctype, manually fix it. (#4736)
     476                                                        if( domDocument.$.compatMode == 'CSS1Compat' )
     477                                                        {
     478                                                                editor.on( 'key', function( event )
     479                                                                {
     480                                                                        if( editor.mode != 'wysiwyg' )
     481                                                                                return;
     482
     483                                                                        if( event.data.keyCode in { 33 : 1, 34 : 1 } )
     484                                                                        {
     485                                                                                setTimeout( function ()
     486                                                                                {
     487                                                                                        editor.getSelection().scrollIntoView();
     488                                                                                }, 0 );
     489                                                                        }
     490                                                                } );
     491                                                        }
     492                                                }
    474493
    475494                                                // Adds the document body as a context menu target.
    476495                                                if ( editor.contextMenu )
  • _source/plugins/selection/plugin.js

     
    949949                        }
    950950                        this.selectRanges( ranges );
    951951                        return this;
     952                },
     953
     954                // Moving scroll bar to the current selection's start position.
     955                scrollIntoView : function()
     956                {
     957                        // If we have split the block, adds a temporary span at the
     958                        // range position and scroll relatively to it.
     959                        var start = this.getStartElement();
     960                        start.scrollIntoView();
    952961                }
    953962        };
    954963})();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy