Ticket #2874: 2874.patch

File 2874.patch, 2.5 KB (added by martinkou, 3 years ago)
  • editor/dialog/fck_table.html

     
    155155        SetAttribute( table, 'cellSpacing'      , GetE('txtCellSpacing').value ) ; 
    156156        SetAttribute( table, 'summary'          , GetE('txtSummary').value ) ; 
    157157 
    158         var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; 
    159  
    160         if ( document.getElementById('txtCaption').value != '') 
    161         { 
    162                 if ( !eCaption ) 
    163                 { 
    164                         eCaption = oDoc.createElement( 'CAPTION' ) ; 
    165                         table.insertBefore( eCaption, table.firstChild ) ; 
    166                 } 
    167  
    168                 eCaption.innerHTML = document.getElementById('txtCaption').value ; 
    169         } 
    170         else if ( bExists && eCaption ) 
    171         { 
    172                 // TODO: It causes an IE internal error if using removeChild or 
    173                 // table.deleteCaption() (see #505). 
    174                 if ( oEditor.FCKBrowserInfo.IsIE ) 
    175                         eCaption.innerHTML = '' ; 
    176                 else 
    177                         eCaption.parentNode.removeChild( eCaption ) ; 
    178         } 
    179  
    180158        var headers = GetE('selHeaders').value ; 
    181159        if ( bExists ) 
    182160        { 
     
    307285                oEditor.FCK.InsertElement( table ) ; 
    308286        } 
    309287 
     288        var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; 
     289 
     290        if ( document.getElementById('txtCaption').value != '' ) 
     291        { 
     292                if ( !eCaption ) 
     293                { 
     294                        eCaption = oDoc.createElement( 'CAPTION' ) ; 
     295                        table.insertBefore( eCaption, table.firstChild ) ; 
     296                } 
     297 
     298                eCaption.innerHTML = document.getElementById('txtCaption').value ; 
     299        } 
     300        else if ( bExists && eCaption ) 
     301        { 
     302                // TODO: It causes an IE internal error if using removeChild or 
     303                // table.deleteCaption() (see #505). 
     304                if ( oEditor.FCKBrowserInfo.IsIE ) 
     305                        eCaption.innerHTML = '' ; 
     306                else 
     307                        eCaption.parentNode.removeChild( eCaption ) ; 
     308        } 
     309 
    310310        return true ; 
    311311} 
    312312 
  • _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/2874">#2874</a>] Fixed wrong position 
     79                        of caption tag in tables with table headers.</li> 
    7880        </ul> 
    7981        <p> 
    8082                <a href="_whatsnew_history.html">See previous versions history</a></p> 
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy