Ticket #3374: 3374.patch

File 3374.patch, 1.4 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/indent/plugin.js

     
    143143
    144144                // Convert the array back to a DOM forest (yes we might have a few subtrees now).
    145145                // And replace the old list with the new forest.
    146                 var newList = CKEDITOR.plugins.list.arrayToList( listArray, null, null, editor.config.enterMode );
     146                var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode, 0 );
    147147                if ( newList )
    148148                        newList.listNode.replace( listNode );
    149149
     
    233233                                return;
    234234
    235235                        var bookmarks = selection.createBookmarks( true ),
    236                                 boundaryNodes = range.getBoundaryNodes(),
    237                                 nearestListBlock = boundaryNodes.startNode.getCommonAncestor( boundaryNodes.endNode );
     236                                nearestListBlock = range.getCommonAncestor();
    238237
    239                         while ( nearestListBlock )
    240                         {
    241                                 if ( nearestListBlock.type == CKEDITOR.NODE_ELEMENT && listNodeNames[ nearestListBlock.getName() ] )
    242                                         break;
     238                        while ( !( nearestListBlock.type == CKEDITOR.NODE_ELEMENT &&
     239                                listNodeNames[ nearestListBlock.getName() ] ) )
    243240                                nearestListBlock = nearestListBlock.getParent();
    244                         }
    245241
    246242                        if ( nearestListBlock )
    247243                                indentList.call( this, editor, range, nearestListBlock );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy