Changeset 669

Show
Ignore:
Timestamp:
2007-08-16 17:09:21 (16 months ago)
Author:
alfonsoml
Message:

Reuse the AnchorDelete command introduced in [643]

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/dialog/fck_anchor.html

    r341 r669  
    8484                if ( oAnchor ) 
    8585                { 
    86                         RemoveAnchor() ; 
     86                        // Removes the current anchor from the document using the new command 
     87                        FCK.Commands.GetCommand( 'AnchorDelete' ).Execute() ; 
    8788                        return true ; 
    8889                } 
     
    156157 
    157158        return true ; 
    158 } 
    159  
    160 // Removes the current anchor from the document 
    161 function RemoveAnchor() 
    162 { 
    163         // If it's also a link, then just remove the name and exit 
    164         if ( oAnchor.href.length != 0 ) 
    165         { 
    166                 oAnchor.removeAttribute( 'name' ) ; 
    167                 // Remove temporary class for IE 
    168                 if ( FCKBrowserInfo.IsIE ) 
    169                         oAnchor.className = oAnchor.className.replace( FCKRegexLib.FCK_Class, '' ) ; 
    170                 return ; 
    171         } 
    172  
    173         // We need to remove the anchor 
    174         // If we got a fake image, then just remove it and we're done 
    175         if ( oFakeImage ) 
    176         { 
    177                 oFakeImage.parentNode.removeChild( oFakeImage ) ; 
    178                 return ; 
    179         } 
    180         // Empty anchor, so just remove it 
    181         if ( oAnchor.innerHTML.length == 0 ) 
    182         { 
    183                 oAnchor.parentNode.removeChild( oAnchor ) ; 
    184                 return ; 
    185         } 
    186         // Anchor with content, leave the content 
    187         FCKTools.RemoveOuterTags( oAnchor ) ; 
    188159} 
    189160