Ticket #6728: 6728_3.patch

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

     
    140140                return null;
    141141        }
    142142
    143         function getFullySelected( range, elements, enterMode )
     143        function getFullySelected( range, elements, enterMode, dir )
    144144        {
    145145                var ancestor = range.getCommonAncestor( false, true );
    146146
     147                var ancestorDir = ancestor.getDirection();
     148                if ( ancestorDir && ancestorDir != dir )
     149                        return ancestor;
     150
    147151                enterMode != CKEDITOR.ENTER_BR && range.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS );
    148152
    149153                if ( range.checkBoundaryOfElement( ancestor, CKEDITOR.START )
     
    191195                                        if ( !selectedElement || selectedElement
    192196                                                        && !( selectedElement.type == CKEDITOR.NODE_ELEMENT && selectedElement.getName() in directSelectionGuardElements )
    193197                                                )
    194                                                 selectedElement = getFullySelected( range, guardElements, enterMode );
     198                                                selectedElement = getFullySelected( range, guardElements, enterMode, dir );
    195199
    196200                                        if ( selectedElement && !selectedElement.isReadOnly() )
    197201                                                switchDir( selectedElement, dir, editor, database );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy