1461 | | // Extract the contents of the block from the selection point to the end |
1462 | | // of its contents. |
1463 | | this.setEndAt( startBlock, CKEDITOR.POSITION_BEFORE_END ); |
1464 | | var documentFragment = this.extractContents(); |
1465 | | |
1466 | | // Duplicate the block element after it. |
1467 | | endBlock = startBlock.clone( false ); |
1468 | | |
1469 | | // Place the extracted contents into the duplicated block. |
1470 | | documentFragment.appendTo( endBlock ); |
1471 | | endBlock.insertAfter( startBlock ); |
1472 | | this.moveToPosition( startBlock, CKEDITOR.POSITION_AFTER_END ); |
1473 | | |
| 1461 | this.splitElement( startBlock ); |
| 1480 | * Branch the specified element from the collapsed range position and |
| 1481 | * place the caret between the two result branches. |
| 1482 | * Note: The range must be collapsed and been enclosed by this element. |
| 1483 | * @param {CKEDITOR.dom.element} element |
| 1484 | */ |
| 1485 | splitElement : function( toSplit ) |
| 1486 | { |
| 1487 | if( !this.collapsed ) |
| 1488 | return; |
| 1489 | |
| 1490 | // Extract the contents of the block from the selection point to the end |
| 1491 | // of its contents. |
| 1492 | this.setEndAt( toSplit, CKEDITOR.POSITION_BEFORE_END ); |
| 1493 | var documentFragment = this.extractContents(); |
| 1494 | |
| 1495 | // Duplicate the element after it. |
| 1496 | var clone = toSplit.clone( false ); |
| 1497 | |
| 1498 | // Place the extracted contents into the duplicated element. |
| 1499 | documentFragment.appendTo( clone ); |
| 1500 | clone.insertAfter( toSplit ); |
| 1501 | this.moveToPosition( toSplit, CKEDITOR.POSITION_AFTER_END ); |
| 1502 | }, |
| 1503 | |
| 1504 | /** |