X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ftabletools%2Fplugin.js;h=0019a498f4f8fb8df2d144b2307ea78c763579b2;hp=b06f59a50bb24696386a277c0e5c69011bad5355;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/plugins/tabletools/plugin.js b/_source/plugins/tabletools/plugin.js index b06f59a..0019a49 100644 --- a/_source/plugins/tabletools/plugin.js +++ b/_source/plugins/tabletools/plugin.js @@ -146,7 +146,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return; // Create a clone of the row. - var newRow = row.clone( true ); + var newRow = row.clone( 1 ); insertBefore ? newRow.insertBefore( row ) : @@ -216,7 +216,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { // Get the cell where the selection is placed in. var startElement = selection.getStartElement(); - var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true ); + var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 ); if ( !cell ) return; @@ -234,7 +234,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( $row.cells.length < ( cellIndex + 1 ) ) continue; - cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( false ); + cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( 0 ); if ( !CKEDITOR.env.ie ) cell.appendBogus(); @@ -339,7 +339,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license function insertCell( selection, insertBefore ) { var startElement = selection.getStartElement(); - var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true ); + var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 ); if ( !cell ) return; @@ -714,9 +714,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { exec : function( editor ) { - var selection = editor.getSelection(); - var startElement = selection && selection.getStartElement(); - var table = startElement && startElement.getAscendant( 'table', true ); + var selection = editor.getSelection(), + startElement = selection && selection.getStartElement(), + table = startElement && startElement.getAscendant( 'table', 1 ); if ( !table ) return; @@ -727,9 +727,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license range.collapse(); selection.selectRanges( [ range ] ); - // If the table's parent has only one child, remove it,except body,as well.( #5416 ) + // If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289) var parent = table.getParent(); - if ( parent.getChildCount() == 1 && parent.getName() != 'body' ) + if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) ) parent.remove(); else table.remove();