Ticket #4736: 4736_2.patch

File 4736_2.patch, 2.4 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                                                {
    455                                                         editor.on( 'key', function( event )
     454                                                        // Cancel default action for backspace in IE on control types. (#4047)
     455                                                        domDocument.on( 'keydown', function( evt )
    456456                                                        {
    457                                                                 if( editor.mode != 'wysiwyg' )
    458                                                                         return;
    459 
    460457                                                                // Backspace.
    461                                                                 var control = event.data.keyCode == 8
     458                                                                var control = evt.data.getKeystroke() == 8
    462459                                                                                          && editor.getSelection().getSelectedElement();
    463460                                                                if ( control )
    464461                                                                {
     
    467464                                                                        // Remove manually.
    468465                                                                        control.remove();
    469466                                                                        editor.fire( 'saveSnapshot' );
    470                                                                         event.cancel();
     467                                                                        evt.cancel();
    471468                                                                }
    472469                                                        } );
    473                                                 }
     470
     471                                                        // PageUp/PageDown scrolling is broken in document
     472                                                        // with standard doctype, manually fix it. (#4736)
     473                                                        if( domDocument.$.compatMode == 'CSS1Compat' )
     474                                                        {
     475                                                                var pageUpDownKeys = { 33 : 1, 34 : 1 };
     476                                                                domDocument.on( 'keydown', function( evt )
     477                                                                {
     478                                                                        if( evt.data.getKeystroke() in pageUpDownKeys )
     479                                                                        {
     480                                                                                setTimeout( function ()
     481                                                                                {
     482                                                                                        editor.getSelection().scrollIntoView();
     483                                                                                }, 0 );
     484                                                                        }
     485                                                                } );
     486                                                        }
     487                                                }
    474488
    475489                                                // Adds the document body as a context menu target.
    476490                                                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