Ticket #2486: 2486.patch

File 2486.patch, 2.2 KB (added by shri, 16 years ago)

Revised patch

  • _whatsnew.html

     
    6262                        now are shown properly.</li>
    6363                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2496">#2496</a>] Using the Paste
    6464                        dialogs in IE might insert the content at the start of the editor.</li>
     65                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2486">#2486</a>] Vertically splitting
     66                        cell with colspan > 1 breaks table layout.</li>
    6567        </ul>
    6668        <p>
    6769                <a href="_whatsnew_history.html">See previous versions history</a></p>
  • editor/_source/internals/fcktablehandler.js

     
    518518        var currentRowIndex = currentCell.parentNode.rowIndex ;
    519519        var cellIndex = FCKTableHandler._GetCellIndexSpan( tableMap, currentRowIndex, currentCell ) ;
    520520        var currentRowSpan = currentCell.rowSpan ;
     521        // Save current cell colSpan
     522        var currentColSpan = isNaN( currentCell.colSpan ) ? 1 : currentCell.colSpan ;
    521523        if ( isNaN( currentRowSpan ) )
    522524                currentRowSpan = 1 ;
    523525
     
    539541                        }
    540542                }
    541543
    542                 // 3. Insert the new cell to the indicated place, with the appropriate rowSpan, next row.
     544                // 3. Insert the new cell to the indicated place, with the appropriate rowSpan and colSpan, next row.
    543545                var newCell = FCK.EditorDocument.createElement( currentCell.nodeName ) ;
    544546                newCell.rowSpan = Math.floor( currentRowSpan / 2 ) ;
     547                newCell.colSpan = currentColSpan ;
    545548                if ( FCKBrowserInfo.IsGeckoLike )
    546549                        FCKTools.AppendBogusBr( newCell ) ;
    547550                currentCell.parentNode.parentNode.rows[newCellRowIndex].insertBefore( newCell, insertMarker ) ;
     
    575578                        i += colSpan ;
    576579                }
    577580
    578                 // 3. Insert a new cell to new row.
     581                // 3. Insert a new cell to new row. Set colSpan on the new cell.
    579582                var newCell = FCK.EditorDocument.createElement( currentCell.nodeName ) ;
     583                newCell.colSpan = currentColSpan ;
    580584                if ( FCKBrowserInfo.IsGeckoLike )
    581585                        FCKTools.AppendBogusBr( newCell ) ;
    582586                newRow.appendChild( newCell ) ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy