Changeset 139

Show
Ignore:
Timestamp:
2007-02-17 13:01:31 (20 months ago)
Author:
fredck
Message:

Fixed #81. IE has (another) DOM bug, which caused FCKDomTools.RTrimNode to break.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckdomtools.js

    r132 r139  
    8989                                        if ( sTrimmed.length == 0 ) 
    9090                                        { 
    91                                                 node.removeChild( eChildNode ) ; 
     91                                                // If the trimmed text node is empty, just remove it. 
     92                                                 
     93                                                // Use "eChildNode.parentNode" instead of "node" to avoid IE bug (#81). 
     94                                                eChildNode.parentNode.removeChild( eChildNode ) ; 
    9295                                                continue ; 
    9396                                        } 
    9497                                        else if ( sTrimmed.length < iOriginalLength ) 
    9598                                        { 
     99                                                // If the trimmed text lenght is less than the original 
     100                                                // lenght, strip all spaces from the end by splitting 
     101                                                // the text and removing the resulting useless node. 
     102 
    96103                                                eChildNode.splitText( sTrimmed.length ) ; 
    97                                                 node.removeChild( node.lastChild ) ; 
     104                                                // Use "node.lastChild.parentNode" instead of "node" to avoid IE bug (#81). 
     105                                                node.lastChild.parentNode.removeChild( node.lastChild ) ; 
    98106                                        } 
    99107                        }