Ticket #9057: 9057.patch

File 9057.patch, 2.2 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/list/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    108108                                paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
    109109                        while ( 1 )
    110110                        {
    111                                 var item = listArray[ currentIndex ];
     111                                var item = listArray[ currentIndex ],
     112                                        itemGrandParent = item.grandparent;
    112113
    113114                                orgDir = item.element.getDirection( 1 );
    114115
     
    144145                                        currentListItem.append( listData.listNode );
    145146                                        currentIndex = listData.nextIndex;
    146147                                }
    147                                 else if ( item.indent == -1 && !baseIndex && item.grandparent )
     148                                else if ( item.indent == -1 && !baseIndex && itemGrandParent )
    148149                                {
    149                                         if ( listNodeNames[ item.grandparent.getName() ] )
     150                                        if ( listNodeNames[ itemGrandParent.getName() ] )
    150151                                                currentListItem = item.element.clone( false, true );
    151152                                        else
    152153                                                currentListItem = new CKEDITOR.dom.documentFragment( doc );
    153154
    154155                                        // Migrate all children to the new container,
    155156                                        // apply the proper text direction.
    156                                         var dirLoose = item.grandparent.getDirection( 1 ) != orgDir,
    157                                                 needsBlock = currentListItem.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT &&
    158                                                                          paragraphMode != CKEDITOR.ENTER_BR,
     157                                        var dirLoose = itemGrandParent.getDirection( 1 ) != orgDir,
    159158                                                li = item.element,
    160159                                                className = li.getAttribute( 'class' ),
    161160                                                style = li.getAttribute( 'style' );
    162161
     162                                        var needsBlock = currentListItem.type ==
     163                                                         CKEDITOR.NODE_DOCUMENT_FRAGMENT &&
     164                                                         ( paragraphMode != CKEDITOR.ENTER_BR || dirLoose ||
     165                                                           style || className );
     166
    163167                                        var child, count = item.contents.length;
    164168                                        for ( i = 0 ; i < count; i++ )
    165169                                        {
     
    178182
    179183                                                        className && child.addClass( className );
    180184                                                }
    181                                                 else if ( dirLoose || needsBlock || style || className )
     185                                                else if ( needsBlock )
    182186                                                {
    183187                                                        // Establish new block to hold text direction and styles.
    184188                                                        if ( !block )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy