Ticket #3807: 3807.patch

File 3807.patch, 1.3 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/selection/plugin.js

     
    2020                        if ( !sel )
    2121                                return;
    2222
     23                        // Prevent caret anchor at the end edge of paragraph followed by a text node,
     24                        // because the cursor will be 'visually' at next line of text.(#3807)
     25                        var range, endBlock, nextTextNode;
     26                        if ( CKEDITOR.env.ie
     27                                 && ( range = sel.getRanges()[ 0 ] )
     28                                 && ( ( endBlock = range.endContainer ) && endBlock.is && endBlock.isBlockBoundary() )
     29                                 && range.endOffset == endBlock.getChildren().count()
     30                                 && ( ( nextTextNode = endBlock.getNext() ) && nextTextNode.type == CKEDITOR.NODE_TEXT ) )
     31                        {
     32                                // Cheat IE to have the cursor anchored inside next text node.
     33                                var dummy = range.document.createText( '\ufeff' );
     34                                dummy.insertBefore( nextTextNode );
     35                                setTimeout( function(){ dummy.remove(); }, 0 );
     36                        }
     37
    2338                        var firstElement = sel.getStartElement();
    2439                        var currentPath = new CKEDITOR.dom.elementPath( firstElement );
    2540
     
    3045                        }
    3146                }
    3247                catch (e)
    33                 {}
    34         }
     48                {
     49                        throw e;
     50                }
     51        }
    3552
    3653        var checkSelectionChangeTimer,
    3754                checkSelectionChangeTimeoutPending;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy