Ticket #7448: 7448.patch

File 7448.patch, 1.2 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/list/plugin.js

     
    464464                this.type = type;
    465465        }
    466466
     467        // Move direction attribute from root to list items.
     468        function dirToListItems( list )
     469        {
     470                var dir = list.getDirection();
     471                if ( dir )
     472                {
     473                        for ( var i = 0, children = list.getChildren(), child; child = children.getItem( i ), i < children.count(); i++ )
     474                        {
     475                                if ( child.type == CKEDITOR.NODE_ELEMENT && child.is( 'li' ) && !child.getDirection() )
     476                                        child.setAttribute( 'dir', dir );
     477                        }
     478
     479                        list.removeAttribute( 'dir' );
     480                }
     481        }
     482
    467483        listCommand.prototype = {
    468484                exec : function( editor )
    469485                {
     
    617633                                        if ( sibling && sibling.getName &&
    618634                                                 sibling.getName() == listCommand.type )
    619635                                        {
     636
     637                                                // In case to be merged lists have difference directions. (#7448)
     638                                                if ( sibling.getDirection( 1 ) != listNode.getDirection( 1 ) )
     639                                                        dirToListItems( listNode.getDirection() ? listNode : sibling );
     640
    620641                                                sibling.remove();
    621642                                                // Move children order by merge direction.(#3820)
    622643                                                sibling.moveChildren( listNode, rtl );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy