Ticket #5462: 5462.patch

File 5462.patch, 1.6 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/styles/plugin.js

     
    403403
    404404                // Bookmark the range so we can re-select it after processing.
    405405                var bookmark = range.createBookmark();
     406                bookmark.startNode.setAttribute( '_cke_bookmark', 1 );          // Avoid the bookmark nodes from been merged.
    406407
    407408                // Expand the range.
    408409                range.enlarge( CKEDITOR.ENLARGE_ELEMENT );
    409410                range.trim();
    410411
    411                 // Remove all style conflictions within the range,
    412                 // e.g. style="color:red" is conflicting with style="color:blue".
    413                 var enlargedBookmark = range.createBookmark();
    414                 this.removeConflictsFromRange( range );
    415                 range.moveToBookmark( enlargedBookmark );
    416 
    417412                // Get the first node to be processed and the last, which concludes the
    418413                // processing.
    419414                var boundaryNodes = range.getBoundaryNodes();
     
    578573                                        // Move the contents of the range to the style element.
    579574                                        styleRange.extractContents().appendTo( styleNode );
    580575
     576                                        var bm = styleRange.createBookmark();
     577                                        styleRange.selectNodeContents( bm.startNode );
     578                                        styleRange.enlarge( CKEDITOR.ENLARGE_ELEMENT );
     579
     580                                        // Remove all style conflictions within the range,
     581                                        // e.g. style="color:red" is conflicting with style="color:blue".
     582                                        this.removeConflictsFromRange( styleRange );
     583                                        styleRange.moveToBookmark( bm );
     584
    581585                                        // Insert it into the range position (it is collapsed after
    582586                                        // extractContents.
    583587                                        styleRange.insertNode( styleNode );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy