- Timestamp:
- 2008-08-05 12:13:32 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/versions/2.6.x/editor/dialog/fck_anchor.html
r2288 r2329 120 120 121 121 if ( aNewAnchors.length == 0 ) 122 { 123 // Nothing was selected, so now just create a normal A 124 if ( FCKBrowserInfo.IsIE ) 125 aNewAnchors.push( oEditor.FCK.InsertElement( '<a name="' + FCKTools.HTMLEncode( sNewName ).replace( '"', '"' ) + '">' ) ) ; 126 else 127 { 128 var n = oEditor.FCK.InsertElement( 'a' ) ; 129 n.name = sNewName ; 130 aNewAnchors.push( n ) ; 131 } 132 } 122 aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ; 133 123 else 134 124 { … … 142 132 { 143 133 oAnchor = aNewAnchors[i] ; 134 135 // Set the name 136 if ( FCKBrowserInfo.IsIE ) 137 { 138 // Setting anchor names directly in IE will trash the HTML code stored 139 // in FCKTempBin after undos. See #2263. 140 var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' + 141 FCKTools.HTMLEncode( sNewName ).replace( '"', '"' ) + '">' ) ; 142 oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ; 143 oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ; 144 oAnchor = replaceAnchor ; 145 } 146 else 147 oAnchor.name = sNewName ; 144 148 145 149 // IE does require special processing to show the Anchor's image