Changeset 7549


Ignore:
Timestamp:
07/06/12 17:40:12 (3 years ago)
Author:
garry.yao
Message:

#9105: Fixed inadequate cleanup after joining list item with previous on Backspace key.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CKEditor/trunk/_source/plugins/list/plugin.js

    r7548 r7549  
    836836                }
    837837
    838                 // Remove any remaining empty path blocks.
     838                // Remove any remaining empty path blocks at next line after merging.
    839839                while ( nextCursor.checkStartOfBlock() &&
    840840                         nextCursor.checkEndOfBlock() )
    841841                {
    842842                        nextPath = new CKEDITOR.dom.elementPath( nextCursor.startContainer );
    843                         var nextBlock = nextPath.block;
     843                        var nextBlock = nextPath.block, parent;
     844
     845                        // Check if also to remove empty list.
     846                        if ( nextBlock.is( 'li' ) )
     847                        {
     848                                parent = nextBlock.getParent();
     849                                if ( nextBlock.equals( parent.getLast( nonEmpty ) )
     850                                                && nextBlock.equals( parent.getFirst( nonEmpty ) ) )
     851                                        nextBlock = parent;
     852                        }
    844853
    845854                        nextCursor.moveToPosition( nextBlock, CKEDITOR.POSITION_BEFORE_START );
Note: See TracChangeset for help on using the changeset viewer.
© 2003 – 2015 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy