Ticket #2411: 2411.patch

File 2411.patch, 1.3 KB (added by Martin Kou, 16 years ago)
  • editor/dialog/fck_anchor.html

     
    124124                if ( FCKBrowserInfo.IsIE )
    125125                        aNewAnchors.push( oEditor.FCK.InsertElement( '<a name="' + FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ) ;
    126126                else
    127                 {
    128                         var n = oEditor.FCK.InsertElement( 'a' ) ;
    129                         n.name = sNewName ;
    130                         aNewAnchors.push( n ) ;
    131                 }
     127                        aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
    132128        }
    133129        else
    134130        {
     
    142138        {
    143139                oAnchor = aNewAnchors[i] ;
    144140
     141                // Set the name
     142                if ( FCKBrowserInfo.IsIE )
     143                {
     144                        // Setting anchor names directly in IE will trash the HTML code stored
     145                        // in FCKTempBin after undos. See #2263.
     146                        var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
     147                                        FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
     148                        oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
     149                        oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
     150                        oAnchor = replaceAnchor ;
     151                }
     152                else
     153                        oAnchor.name = sNewName ;
     154
    145155                // IE does require special processing to show the Anchor's image
    146156                // Opera doesn't allow to select empty anchors
    147157                if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy