Ticket #2486: 2486_1.patch

File 2486_1.patch, 2.3 KB (added by shri, 16 years ago)
  • _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

     
    517517        var tableMap = this._CreateTableMap( currentCell ) ;
    518518        var currentRowIndex = currentCell.parentNode.rowIndex ;
    519519        var cellIndex = FCKTableHandler._GetCellIndexSpan( tableMap, currentRowIndex, currentCell ) ;
     520        // Save current cell colSpan
     521        var currentColSpan = isNaN( currentCell.colSpan ) ? 1 : currentCell.colSpan ;   
    520522        var currentRowSpan = currentCell.rowSpan ;
    521523        if ( isNaN( currentRowSpan ) )
    522524                currentRowSpan = 1 ;
     
    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                if ( currentColSpan > 1 )
     548                        newCell.colSpan = currentColSpan ;
    545549                if ( FCKBrowserInfo.IsGeckoLike )
    546550                        FCKTools.AppendBogusBr( newCell ) ;
    547551                currentCell.parentNode.parentNode.rows[newCellRowIndex].insertBefore( newCell, insertMarker ) ;
     
    575579                        i += colSpan ;
    576580                }
    577581
    578                 // 3. Insert a new cell to new row.
     582                // 3. Insert a new cell to new row. Set colSpan on the new cell.
    579583                var newCell = FCK.EditorDocument.createElement( currentCell.nodeName ) ;
     584                if ( currentColSpan > 1 )
     585                        newCell.colSpan = currentColSpan ;             
    580586                if ( FCKBrowserInfo.IsGeckoLike )
    581587                        FCKTools.AppendBogusBr( newCell ) ;
    582588                newRow.appendChild( newCell ) ;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy