Ticket #8997: 8997_2.patch

File 8997_2.patch, 1.6 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
     
    299299                }
    300300
    301301                var root = groupObj.root,
    302                         fakeParent = root.getDocument().createElement( this.type );
    303                 // Copy all attributes, except from 'start' and 'type'.
    304                 root.copyAttributes( fakeParent, { start : 1, type : 1 } );
    305                 // The list-style-type property should be ignored.
    306                 fakeParent.removeStyle( 'list-style-type' );
     302                        doc = root.getDocument(),
     303                        listNode,
     304                        newListNode;
    307305
    308306                for ( i = 0 ; i < selectedListItems.length ; i++ )
    309307                {
    310308                        var listIndex = selectedListItems[i].getCustomData( 'listarray_index' );
    311                         listArray[listIndex].parent = fakeParent;
    312                 }
     309                        listNode = listArray[ listIndex ].parent;
     310
     311                        // Switch to new list node for this particular item.
     312                        if ( !listNode.is( this.type ) )
     313                        {
     314                                newListNode = doc.createElement( this.type );
     315                                // Copy all attributes, except from 'start' and 'type'.
     316                                listNode.copyAttributes( newListNode, { start : 1, type : 1 } );
     317                                // The list-style-type property should be ignored.
     318                                newListNode.removeStyle( 'list-style-type' );
     319                                listArray[ listIndex ].parent = newListNode;
     320                        }
     321                }
     322
    313323                var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode );
    314324                var child, length = newList.listNode.getChildCount();
    315325                for ( i = 0 ; i < length && ( child = newList.listNode.getChild( i ) ) ; i++ )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy