Ticket #3677: 3677.patch

File 3677.patch, 2.3 KB (added by Martin Kou, 15 years ago)
  • editor/_source/internals/fck_ie.js

     
    378378{
    379379        // Creates the array that will be returned. It contains one or more created links (see #220).
    380380        var aCreatedLinks = new Array() ;
     381        var isControl = FCKSelection.GetType() == 'Control' ;
     382        var selectedElement = isControl && FCKSelection.GetSelectedElement() ;
    381383
    382384        // Remove any existing link in the selection.
    383         FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
     385        // IE BUG: Unlinking a floating control selection that is not inside a link
     386        // will collapse the selection. (#3677)
     387        if ( !( isControl && !FCKTools.GetElementAscensor( selectedElement, 'a' ) ) )
     388                FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ;
    384389
    385390        if ( url.length > 0 )
    386391        {
    387392                // If there are several images, and you try to link each one, all the images get inside the link:
    388393                // <img><img> -> <a><img></a><img> -> <a><img><img></a> due to the call to 'CreateLink' (bug in IE)
    389                 if (FCKSelection.GetType() == 'Control')
     394                if ( isControl )
    390395                {
    391396                        // Create a link
    392397                        var oLink = this.EditorDocument.createElement( 'A' ) ;
    393398                        oLink.href = url ;
    394399
    395400                        // Get the selected object
    396                         var oControl = FCKSelection.GetSelectedElement() ;
     401                        var oControl = selectedElement ;
    397402                        // Put the link just before the object
    398403                        oControl.parentNode.insertBefore(oLink, oControl) ;
    399404                        // Move the object inside the link
  • _whatsnew.html

     
    7575                        custom connector tried to use the "url" attribute for files it was always reencoded.</li>
    7676                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1537">#1537</a>] Fixed extra
    7777                        &lt;p&gt; tag added before pasted contents from Paste From Word dialog.</li>
     78                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/3677">#3677</a>] Fixed JavaScript
     79                        error when trying to create link for images inside floating div containers.</li>
    7880        </ul>
    7981        <p>
    8082                <a href="_whatsnew_history.html">See previous versions history</a></p>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy