Ticket #6728: 6728.patch

File 6728.patch, 1.1 KB (added by Tobiasz Cudnik, 14 years ago)
  • _source/plugins/bidi/plugin.js

     
    136136                return null;
    137137        }
    138138
    139         function getFullySelected( range, elements )
     139        function getFullySelected( range, elements, dir )
    140140        {
    141141                var ancestor = range.getCommonAncestor( false, true );
    142142
     143                var ancestorDir = ancestor.getDirection();
     144                if ( ancestorDir && ancestorDir != dir )
     145                        return ancestor;
     146
    143147                range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS );
    144148
    145149                if ( range.checkBoundaryOfElement( ancestor, CKEDITOR.START )
     
    187191                                        if ( !selectedElement || selectedElement
    188192                                                        && !( selectedElement.type == CKEDITOR.NODE_ELEMENT && selectedElement.getName() in directSelectionGuardElements )
    189193                                                )
    190                                                 selectedElement = getFullySelected( range, guardElements );
     194                                                selectedElement = getFullySelected( range, guardElements, dir );
    191195
    192196                                        if ( selectedElement && !selectedElement.isReadOnly() )
    193197                                                switchDir( selectedElement, dir, editor, database );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy