Ticket #3133: 3313_2.patch
File 3313_2.patch, 2.8 KB (added by , 15 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
68 68 69 69 // Remove the original contents. 70 70 range.deleteContents(); 71 72 // Place the editing carot after the editing end of previous node. 73 range.moveToElementEditEnd( range.getBoundaryNodes().endNode ); 71 74 72 75 clone = !i && element || element.clone( true ); 73 76 -
_source/core/dom/range.js
1485 1485 1486 1486 return walker.checkForward(); 1487 1487 }, 1488 1489 1488 /** 1490 * Moves the range boundaries to the first editing point inside an1489 * Moves the range boundaries to the first/end editing point inside an 1491 1490 * element. For example, in an element tree like 1492 1491 * "<p><b><i></i></b> Text</p>", the start editing point is 1493 1492 * "<p><b><i>^</i></b> Text</p>" (inside <i>). … … 1492 1491 * "<p><b><i></i></b> Text</p>", the start editing point is 1493 1492 * "<p><b><i>^</i></b> Text</p>" (inside <i>). 1494 1493 * @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. 1496 1496 */ 1497 moveToElementEdit Start : function( targetElement)1497 moveToElementEditablePosition: function( targetElement, isMoveToEnd ) 1498 1498 { 1499 1499 var editableElement; 1500 1500 … … 1505 1505 else if ( editableElement ) 1506 1506 break ; // If we already found an editable element, stop the loop. 1507 1507 1508 targetElement = targetElement .getFirst();1508 targetElement = targetElement[ isMoveToEnd? 'getLast' : 'getFirst' ].call( targetElement ); 1509 1509 } 1510 1510 1511 1511 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 ); 1513 1530 }, 1514 1531 1515 1532 getTouchedStartNode : function()