Ticket #9063: 9063_2.patch

File 9063_2.patch, 2.8 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/indent/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    142142                                {
    143143                                        listArray[ i ].indent += indentOffset;
    144144                                        // Make sure the newly created sublist get a brand-new element of the same type. (#5372)
    145                                         var listRoot = listArray[ i ].parent;
    146                                         listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );
     145                                        if ( indentOffset > 0 )
     146                                        {
     147                                                var listRoot = listArray[ i ].parent;
     148                                                listArray[ i ].parent = new CKEDITOR.dom.element( listRoot.getName(), listRoot.getDocument() );
     149                                        }
    147150                                }
    148151
    149152                                for ( i = lastItem.getCustomData( 'listarray_index' ) + 1 ;
  • _source/plugins/list/plugin.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    3131                }
    3232        }
    3333
     34        // Inheirt inline styles from another element.
     35        function inheirtInlineStyles( parent, el )
     36        {
     37                var style = parent.getAttribute( 'style' );
     38
     39                // Put parent styles before child styles.
     40                style && el.setAttribute( 'style',
     41                        style.replace( /([^;])$/, '$1;' ) +
     42                        ( el.getAttribute( 'style' ) || '' ) );
     43        }
     44
    3445        CKEDITOR.plugins.list = {
    3546                /*
    3647                 * Convert a DOM list tree into a data structure that is easier to
     
    108119                                paragraphName = ( paragraphMode == CKEDITOR.ENTER_P ? 'p' : 'div' );
    109120                        while ( 1 )
    110121                        {
    111                                 var item = listArray[ currentIndex ];
     122                                var item = listArray[ currentIndex ],
     123                                        itemParent = item.parent;
    112124
    113125                                orgDir = item.element.getDirection( 1 );
    114126
     
    146158                                }
    147159                                else if ( item.indent == -1 && !baseIndex && item.grandparent )
    148160                                {
     161                                        // We're leaving this parent list, inherit it's inline styles.
     162                                        var listNode = itemParent.clone();
     163                                        if ( listNode.hasAttribute( 'style' ) )
     164                                        {
     165                                                listNode.removeStyle( 'list-style-type' );
     166                                                inheirtInlineStyles( listNode, item.element );
     167                                        }
     168
    149169                                        if ( listNodeNames[ item.grandparent.getName() ] )
    150170                                                currentListItem = item.element.clone( false, true );
    151171                                        else
     
    171191                                                        if ( dirLoose && !child.getDirection() )
    172192                                                                child.setAttribute( 'dir', orgDir );
    173193
    174                                                         // Merge into child styles.
    175                                                         style && child.setAttribute( 'style',
    176                                                                                  style.replace( /([^;])$/, '$1;') +
    177                                                                                  ( child.getAttribute( 'style' ) || '' ) );
     194                                                        inheirtInlineStyles( li, child );
    178195
    179196                                                        className && child.addClass( className );
    180197                                                }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy