Ticket #3133: 3313_2.patch

File 3313_2.patch, 2.8 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    6868
    6969                                // Remove the original contents.
    7070                                range.deleteContents();
     71                               
     72                                // Place the editing carot after the editing end of previous node.
     73                                range.moveToElementEditEnd( range.getBoundaryNodes().endNode );
    7174
    7275                                clone = !i && element || element.clone( true );
    7376
  • _source/core/dom/range.js

     
    14851485                       
    14861486                        return walker.checkForward();
    14871487                },
    1488 
    14891488                /**
    1490                  * Moves the range boundaries to the first editing point inside an
     1489                 * Moves the range boundaries to the first/end editing point inside an
    14911490                 * element. For example, in an element tree like
    14921491                 * "<p><b><i></i></b> Text</p>", the start editing point is
    14931492                 * "<p><b><i>^</i></b> Text</p>" (inside <i>).
     
    14921491                 * "<p><b><i></i></b> Text</p>", the start editing point is
    14931492                 * "<p><b><i>^</i></b> Text</p>" (inside <i>).
    14941493                 * @param {CKEDITOR.dom.element} targetElement The element into which
    1495                  *              look for the editing spot.
     1494                 *              look for the editing spot, it should be guaranteed to contains at least one editable position.
     1495                        @param {Boolean} isMoveToEnd Whether move to the end editable position.
    14961496                 */
    1497                 moveToElementEditStart : function( targetElement )
     1497                moveToElementEditablePosition: function( targetElement, isMoveToEnd )
    14981498                {
    14991499                        var editableElement;
    15001500
     
    15051505                                else if ( editableElement )
    15061506                                        break ;         // If we already found an editable element, stop the loop.
    15071507
    1508                                 targetElement = targetElement.getFirst();
     1508                                targetElement = targetElement[ isMoveToEnd? 'getLast' : 'getFirst' ].call( targetElement );
    15091509                        }
    15101510
    15111511                        if ( editableElement )
    1512                                 this.moveToPosition( editableElement, CKEDITOR.POSITION_AFTER_START );
     1512                                this.moveToPosition( editableElement, isMoveToEnd?
     1513                                        CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START );
     1514                },
     1515
     1516                /**
     1517                 *@see {CKEDITOR.dom.range.moveToElementEditablePosition}
     1518                 */
     1519                moveToElementEditStart : function( target )
     1520                {
     1521                        this.moveToElementEditablePosition( target );
     1522                },
     1523
     1524                /**
     1525                 *@see {CKEDITOR.dom.range.moveToElementEditablePosition}
     1526                 */
     1527                moveToElementEditEnd : function( target )
     1528                {
     1529                        this.moveToElementEditablePosition( target, true );
    15131530                },
    15141531
    15151532                getTouchedStartNode : function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy