Ticket #2411: 2411.patch
File 2411.patch, 1.3 KB (added by , 15 years ago) |
---|
-
editor/dialog/fck_anchor.html
124 124 if ( FCKBrowserInfo.IsIE ) 125 125 aNewAnchors.push( oEditor.FCK.InsertElement( '<a name="' + FCKTools.HTMLEncode( sNewName ).replace( '"', '"' ) + '">' ) ) ; 126 126 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' ) ) ; 132 128 } 133 129 else 134 130 { … … 142 138 { 143 139 oAnchor = aNewAnchors[i] ; 144 140 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( '"', '"' ) + '">' ) ; 148 oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ; 149 oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ; 150 oAnchor = replaceAnchor ; 151 } 152 else 153 oAnchor.name = sNewName ; 154 145 155 // IE does require special processing to show the Anchor's image 146 156 // Opera doesn't allow to select empty anchors 147 157 if ( FCKBrowserInfo.IsIE || FCKBrowserInfo.IsOpera )