Ticket #4079: 4079.patch
File 4079.patch, 2.4 KB (added by , 15 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
189 189 190 190 // Inserting the padding-br before body if it's preceded by an 191 191 // unexitable block. 192 var lastNode = body.getLast( true);192 var lastNode = body.getLast( CKEDITOR.dom.walker.whitespaces( true ) ); 193 193 if ( lastNode && lastNode.getName && ( lastNode.getName() in nonExitableElementNames ) ) 194 194 { 195 195 var paddingBlock = editor.document.createElement( -
_source/core/dom/element.js
644 644 }, 645 645 646 646 /** 647 * @param ignoreEmpty Skip empty text nodes.647 * @param {Function} evaluator Filtering the result node. 648 648 */ 649 getLast : function( ignoreEmpty)649 getLast : function( evaluator ) 650 650 { 651 var $ = this.$.lastChild;652 if ( ignoreEmpty && $ && ( $.nodeType == CKEDITOR.NODE_TEXT )653 && !CKEDITOR.tools.trim( $.nodeValue) )654 ret urn new CKEDITOR.dom.node( $ ).getPrevious( true);655 else 656 return $ ? new CKEDITOR.dom.node( $ ) : null;651 var last = this.$.lastChild, 652 retval = last && new CKEDITOR.dom.node( last ); 653 if ( retval && evaluator && !evaluator( retval ) ) 654 retval = retval.getPrevious( evaluator ); 655 656 return retval; 657 657 }, 658 658 659 659 getStyle : function( name ) -
_source/tests/core/dom/element.html
524 524 } 525 525 }, 526 526 527 // Test get last non-spaces child node. 528 test_getLast : function() 529 { 530 var element = new CKEDITOR.dom.element( document.getElementById( 'append' ) ); 531 var span1 = new CKEDITOR.dom.element( 'span' ); 532 element.append( span1 ); 533 element.append( new CKEDITOR.dom.text( ' ' ) ); 534 element.append( new CKEDITOR.dom.text( ' ' ) ); 535 var last = element.getLast( CKEDITOR.dom.walker.whitespaces( true ) ); 536 assert.areSame( span1.$, last.$ ); 537 }, 538 539 527 540 name : document.title 528 541 }; 529 542 })() );