Ticket #3657: 3657_3.patch

File 3657_3.patch, 1.7 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    1515         */
    1616        var nonExitableElementNames = { table:1,pre:1 };
    1717
     18        /**
     19         * IE has already preserved an editing position after table.
     20         */
     21        if( CKEDITOR.env.ie )
     22                delete nonExitableElementNames.table;
     23
    1824        function onInsertHtml( evt )
    1925        {
    2026                if ( this.mode == 'wysiwyg' )
     
    108114        }
    109115       
    110116        /**
    111          *  Auto-fixing block-less content by wrapping paragraph, prevent
    112          *  non-exitable-block by padding extra br.
     117         *  Auto-fixing block-less content by wrapping paragraph (#3190), prevent
     118         *  non-exitable-block by padding extra br.(#3189)
    113119         */
    114120        function onSelectionChangeFixBody( evt )
    115121        {
    116122                var editor = evt.editor,
    117123                        path = evt.data.path,
    118124                        blockLimit = path.blockLimit,
     125                        selection = evt.data.selection,
     126                        selectedElement = selection.getSelectedElement(),
    119127                        body = editor.document.getBody(),
    120128                        enterMode = editor.config.enterMode;
    121129
    122                 // When enterMode set to block, we'll establing new paragraph if the
    123                 // current range is block-less within body.
     130                // When enterMode set to block, we'll establing new paragraph only if we're
     131                // selecting inline contents right under body. (#3657)
    124132                if ( enterMode != CKEDITOR.ENTER_BR
    125133                         && blockLimit.getName() == 'body'
    126                          && !path.block )
     134                         && !path.block
     135                         && !( selectedElement && selectedElement.isBlockLike  && selectedElement.isBlockLike() ) )
    127136                {
    128137                        var selection = evt.data.selection,
    129138                                range = evt.data.selection.getRanges()[0],
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy