Ticket #6004: 6004.patch

File 6004.patch, 2.3 KB (added by Frederico Caldeira Knabben, 14 years ago)
  • _source/core/dom/range.js

     
    397397                        var startNode, endNode;
    398398                        var baseId;
    399399                        var clone;
     400                        var collapsed = this.collapsed;
    400401
    401402                        startNode = this.document.createElement( 'span' );
    402403                        startNode.setAttribute( '_fck_bookmark', 1 );
     
    413414                        }
    414415
    415416                        // If collapsed, the endNode will not be created.
    416                         if ( !this.collapsed )
     417                        if ( !collapsed )
    417418                        {
    418419                                endNode = startNode.clone();
    419420                                endNode.setHtml( ' ' );
     
    442443                        return {
    443444                                startNode : serializable ? baseId + 'S' : startNode,
    444445                                endNode : serializable ? baseId + 'E' : endNode,
    445                                 serializable : serializable
     446                                serializable : serializable,
     447                                collapsed : collapsed
    446448                        };
    447449                },
    448450
     
    465467                        var startOffset = this.startOffset,
    466468                                endOffset       = this.endOffset;
    467469
     470                        var collapsed = this.collapsed;
     471
    468472                        var child, previous;
    469473
    470474                        // If there is no range then get out of here.
     
    501505                                }
    502506
    503507                                // Process the end only if not normalized.
    504                                 if ( !this.isCollapsed )
     508                                if ( !collapsed )
    505509                                {
    506510                                        // Find out if the start is pointing to a text node that
    507511                                        // will be normalized.
     
    532536
    533537                        return {
    534538                                start           : startContainer.getAddress( normalized ),
    535                                 end                     : this.isCollapsed ? null : endContainer.getAddress( normalized ),
     539                                end                     : collapsed ? null : endContainer.getAddress( normalized ),
    536540                                startOffset     : startOffset,
    537541                                endOffset       : endOffset,
    538542                                normalized      : normalized,
     543                                collapsed       : collapsed,
    539544                                is2                     : true          // It's a createBookmark2 bookmark.
    540545                        };
    541546                },
  • _source/plugins/styles/plugin.js

     
    12821282                while ( ( range = iterator.getNextRange() ) )
    12831283                        func.call( this, range );
    12841284
    1285                 selection.selectBookmarks( bookmarks );
     1285                if ( bookmarks.length == 1 && bookmarks[0].collapsed )
     1286                        selection.selectRanges( ranges );
     1287                else
     1288                        selection.selectBookmarks( bookmarks );
    12861289        }
    12871290})();
    12881291
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy