Changeset 233

Show
Ignore:
Timestamp:
2007-03-31 18:27:25 (22 months ago)
Author:
alfonsoml
Message:

Fix for #318 Multiple linked images get merged in a single link in IE

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/developers/alfonsoml/editor/_source/internals/fck_ie.js

    r232 r233  
    357357        if ( url.length > 0 ) 
    358358        { 
     359                // If there are several images, and you try to link each one, all the images get inside the link: 
     360                // <img><img> -> <a><img></a><img> -> <a><img><img></a> due to the call to 'CreateLink' (bug in IE) 
     361                if (FCKSelection.GetType() == 'Control') 
     362                { 
     363                        // Create a link 
     364                        var oLink = this.EditorDocument.createElement( 'A' ) ; 
     365                        oLink.href = url ; 
     366 
     367                        // Get the selected object 
     368                        var oControl = FCKSelection.GetSelectedElement() ; 
     369                        // Put the link just before the object 
     370                        oControl.parentNode.insertBefore(oLink, oControl) ; 
     371                        // Move the object inside the link 
     372                        oControl.parentNode.removeChild( oControl ) ; 
     373                        oLink.appendChild( oControl ) ; 
     374                         
     375                        return oLink ; 
     376                } 
     377 
    359378                // Generate a temporary name for the link. 
    360379                var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;