Ticket #3165: 3165.patch
File 3165.patch, 2.8 KB (added by , 15 years ago) |
---|
-
_source/plugins/enterkey/plugin.js
101 101 if ( !isStartOfBlock && !isEndOfBlock ) 102 102 { 103 103 // If the next block is an <li> with another list tree as the first 104 // child, we'll need to append a placeholderor the list item104 // child, we'll need to append a filler <br> or the list item 105 105 // wouldn't be editable. (#1420) 106 if ( nextBlock.is( 'li' ) && ( node = nextBlock.getFirst() ) 107 && node.is && node.is( 'ul', 'ol') ) 108 nextBlock.insertBefore( doc.createText( '\xa0' ), node ); 106 if ( nextBlock.is( 'li' ) 107 && ( node = nextBlock.getFirst( CKEDITOR.dom.walker.invisible( true ) ) ) 108 && node.is && node.is( 'ul', 'ol' ) ) 109 doc.createElement( 'br' ).insertBefore( node ); 109 110 110 111 // Move the selection to the end block. 111 112 if ( nextBlock ) -
_source/core/dom/element.js
627 627 628 628 /** 629 629 * Gets the first child node of this element. 630 * @param {Function} evaluator Filtering the result node. 630 631 * @returns {CKEDITOR.dom.node} The first child node or null if not 631 632 * available. 632 633 * @example … … 634 635 * var first = <b>element.getFirst()</b>; 635 636 * alert( first.getName() ); // "b" 636 637 */ 637 getFirst : function( )638 getFirst : function( evaluator ) 638 639 { 639 var $ = this.$.firstChild; 640 return $ ? new CKEDITOR.dom.node( $ ) : null; 640 var first = this.$.firstChild, 641 retval = first && new CKEDITOR.dom.node( first ); 642 if ( retval && evaluator && !evaluator( retval ) ) 643 retval = retval.getNext( evaluator ); 644 645 return retval; 641 646 }, 642 647 643 648 /** -
_source/core/dom/walker.js
408 408 return isReject ^ isWhitespace; 409 409 }; 410 410 }; 411 412 /** 413 * Whether the node is invisible in wysiwyg mode. 414 * @param isReject 415 */ 416 CKEDITOR.dom.walker.invisible = function( isReject ) 417 { 418 var whitespace = CKEDITOR.dom.walker.whitespaces(); 419 return function( node ) 420 { 421 // Nodes that take no spaces in wysiwyg: 422 // 1. White-spaces but not including NBSP; 423 // 2. Empty inline elements, e.g. <b></b> we're checking here 'offsetHeight' 424 // instead of width for properly excluding all sorts of empty paragraph, e.g. <br />. 425 var isInvisible = whitespace( node ) 426 || !node.$.offsetHeight; 427 return isReject ^ isInvisible; 428 }; 429 }; 430 411 431 })();