Ticket #3312: 3312_2.patch
File 3312_2.patch, 2.5 KB (added by , 15 years ago) |
---|
-
_source/plugins/enterkey/plugin.js
78 78 79 79 var node; 80 80 81 // If this is a block under a list item, split it as well. (#1647) 81 // 1. If this is a block under a list item, split it as well. (#1647) 82 // 2. Exit the whole list if it's the last empty first-level list item. (#3312) 82 83 if ( nextBlock ) 83 84 { 84 85 node = nextBlock.getParent(); … … 94 95 range.moveToElementEditStart( previousBlock.getNext() ); 95 96 previousBlock.move( previousBlock.getPrevious() ); 96 97 } 98 else if ( ( node = previousBlock ) && node.is( 'li' ) 99 && node.getParent().is( 'ul', 'ol' ) 100 && !node.getNext() 101 && !CKEDITOR.tools.trim( node.getText() ).length ) 102 { 103 var editableElement; 104 // Locate the next content edit-able element of this node. 105 function getNextEditableElement( node ) 106 { 107 var walker = new CKEDITOR.dom.walker( node ); 108 walker.evaluator = function( toNode ){ 109 return ( !!toNode.isEditable && toNode.isEditable() ); 110 }; 111 return walker.next(); 112 } 113 114 if ( editableElement = getNextEditableElement( 115 ( node.getLast && node.getLast() )|| node ) ) 116 { 117 editableElement.scrollIntoView(); 118 range.moveToPosition( editableElement, CKEDITOR.POSITION_AFTER_START ); 119 range.select(); 120 } 97 121 122 return; 123 } 98 124 // If we have both the previous and next blocks, it means that the 99 125 // boundaries were on separated blocks, or none of them where on the 100 126 // block limits (start/end). -
_source/core/dom/element.js
547 547 */ 548 548 getText : function() 549 549 { 550 return this.$.textContent || this.$.innerText ;550 return this.$.textContent || this.$.innerText || ''; 551 551 }, 552 552 553 553 /** -
_source/core/dom/text.js
64 64 65 65 getText : function() 66 66 { 67 return this.$.nodeValue; 67 return this.$.nodeValue || ''; 68 }, 69 70 isEditable : function() 71 { 72 return true; 73 }, 74 75 scrollIntoView : function() 76 { 77 return this.getParent().scrollIntoView(); 68 78 }, 69 79 70 80 /**