Ticket #4047: 4047_2.patch

File 4047_2.patch, 1.1 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    433433                                                if ( keystrokeHandler )
    434434                                                        keystrokeHandler.attach( domDocument );
    435435
     436                                                // Cancel default action for backspace in IE on control types. (#4047)
     437                                                if ( CKEDITOR.env.ie )
     438                                                {
     439                                                        editor.on( 'key', function( event )
     440                                                        {
     441                                                                // Backspace.
     442                                                                var control;
     443                                                                if ( ( event.data.keyCode == 8 )
     444                                                                         &&  ( control = editor.getSelection().getSelectedElement() ) )
     445                                                                {
     446                                                                        // Make undo snapshot.
     447                                                                        editor.fire( 'saveSnapshot' );
     448                                                                        // Remove manually.
     449                                                                        control.remove();
     450                                                                        editor.fire( 'saveSnapshot' );
     451                                                                        event.cancel();
     452                                                                }
     453                                                        } );
     454                                                }
     455
    436456                                                // Adds the document body as a context menu target.
    437457                                                if ( editor.contextMenu )
    438458                                                        editor.contextMenu.addTarget( domDocument );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy