Ticket #3509: 3509_2.patch

File 3509_2.patch, 2.6 KB (added by Josh Nisly, 15 years ago)
  • _source/plugins/enterkey/plugin.js

     
    139139                        if ( !newBlock )
    140140                                newBlock = doc.createElement( blockTag );
    141141
     142                        // We need to insert the bogus element inside all of the inline
     143                        // style elements, so that clicking after the line or pressing end
     144                        // and typing makes the typed text keep these inline styles.
     145                        var blockWithBogus = newBlock;
     146
    142147                        // Recreate the inline elements tree, which was available
    143148                        // before hitting enter, so the same styles will be available in
    144149                        // the new block.
     
    157162                                                element = element.clone();
    158163                                                newBlock.moveChildren( element );
    159164                                                newBlock.append( element );
     165
     166                                                blockWithBogus = element;
    160167                                        }
    161168                                }
    162169                        }
    163170
    164171                        if ( !CKEDITOR.env.ie )
    165                                 newBlock.appendBogus();
     172                                blockWithBogus.appendBogus();
    166173
    167174                        range.insertNode( newBlock );
    168175
  • _source/core/dom/element.js

     
    243243                                lastChild = lastChild.getPrevious();
    244244                        if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) )
    245245                        {
    246                                 this.append(
    247                                         CKEDITOR.env.opera ?
    248                                                 this.getDocument().createText('') :
    249                                                 this.getDocument().createElement( 'br' ) );
     246                                var bogusElement = CKEDITOR.env.opera ?
     247                                                this.getDocument().createText( '' ) :
     248                                                this.getDocument().createElement( 'br' );
     249                                this.append( bogusElement );
     250                                return bogusElement;
    250251                        }
    251252                },
    252253
  • _source/core/dom/range.js

     
    12991299
    13001300                        this.collapse( isStart );
    13011301
     1302                        // If endContainer is at the end of the document, we need to create
     1303                        // a bogus element so that the range can include the entire endContainer.
     1304                        // (This isn't necessary otherwise, but doesn't hurt.)
     1305                        var tempBogus = null;
     1306                        if ( !CKEDITOR.env.ie )
     1307                                tempBogus = this.endContainer.getParent().appendBogus();
     1308
    13021309                        this.enlarge( CKEDITOR.ENLARGE_BLOCK_CONTENTS );
    13031310
    13041311                        this.extractContents().appendTo( fixedBlock );
     
    13071314                        if ( !CKEDITOR.env.ie )
    13081315                                fixedBlock.appendBogus();
    13091316
     1317                        if ( tempBogus )
     1318                                tempBogus.remove();
     1319
    13101320                        this.insertNode( fixedBlock );
    13111321
    13121322                        this.moveToBookmark( bookmark );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy