Changeset 4347


Ignore:
Timestamp:
2009-10-12 16:42:54 (2 years ago)
Author:
garry.yao
Message:

Fixing #4047: Delete selected control type element when 'Backspace' is pressed on it.

Location:
CKEditor/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CKEditor/trunk/CHANGES.html

    r4346 r4347  
    7575                <li><a href="http://dev.fckeditor.net/ticket/3664">#3664</a> : Insert block element in empty editor document should not create new paragraph.</li>  
    7676                <li><a href="http://dev.fckeditor.net/ticket/4037">#4037</a> : 'id' attribute is missing with Flash dialog advanced page.</li>  
     77                <li><a href="http://dev.fckeditor.net/ticket/4047">#4047</a> : Delete selected control type element when 'Backspace' is pressed on it.</li>  
    7778        </ul> 
    7879        <h3> 
  • CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js

    r4344 r4347  
    455455                                                        keystrokeHandler.attach( domDocument ); 
    456456 
     457                                                // Cancel default action for backspace in IE on control types. (#4047) 
     458                                                if ( CKEDITOR.env.ie ) 
     459                                                { 
     460                                                        editor.on( 'key', function( event ) 
     461                                                        { 
     462                                                                // Backspace. 
     463                                                                var control = event.data.keyCode == 8 
     464                                                                                          && editor.getSelection().getSelectedElement(); 
     465                                                                if ( control ) 
     466                                                                { 
     467                                                                        // Make undo snapshot. 
     468                                                                        editor.fire( 'saveSnapshot' ); 
     469                                                                        // Remove manually. 
     470                                                                        control.remove(); 
     471                                                                        editor.fire( 'saveSnapshot' ); 
     472                                                                        event.cancel(); 
     473                                                                } 
     474                                                        } ); 
     475                                                } 
     476 
    457477                                                // Adds the document body as a context menu target. 
    458478                                                if ( editor.contextMenu ) 
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy