Ticket #3146: 3146.patch
File 3146.patch, 1.2 KB (added by , 15 years ago) |
---|
-
_source/plugins/styles/plugin.js
277 277 278 278 // Get the first node to be processed and the last, which concludes the 279 279 // processing. 280 var firstNode = range.startContainer.getChild( range.startOffset ) || range.startContainer.getNextSourceNode(); 281 var lastNode = range.endContainer.getChild( range.endOffset ) || ( range.endOffset ? range.endContainer.getNextSourceNode() : range.endContainer ); 280 var boundaryNodes = range.getBoundaryNodes(); 281 var firstNode = boundaryNodes.startNode; 282 var lastNode = boundaryNodes.endNode; 282 283 284 // The detection algorithm below skips the contents inside bookmark nodes, so 285 // we'll need to make sure lastNode isn't the inside a bookmark node. 286 var lastParent = lastNode.getParent(); 287 if ( lastParent && lastParent.type == CKEDITOR.NODE_ELEMENT && lastParent.getAttribute( '_fck_bookmark' ) ) 288 lastNode = lastParent; 289 283 290 if ( lastNode.equals( firstNode ) ) 284 291 { 285 292 // If the last node is the same as the the first one, we must move