Ticket #6289: 6289.patch

File 6289.patch, 1.3 KB (added by Sa'ar Zac Elias, 14 years ago)
  • _source/plugins/tabletools/plugin.js

     
    714714                                {
    715715                                        exec : function( editor )
    716716                                        {
    717                                                 var selection = editor.getSelection();
    718                                                 var startElement = selection && selection.getStartElement();
    719                                                 var table = startElement && startElement.getAscendant( 'table', true );
     717                                                var selection = editor.getSelection(),
     718                                                        startElement = selection && selection.getStartElement(),
     719                                                        table = startElement && startElement.getAscendant( 'table', 1 );
    720720
    721721                                                if ( !table )
    722722                                                        return;
     
    727727                                                range.collapse();
    728728                                                selection.selectRanges( [ range ] );
    729729
    730                                                 // If the table's parent has only one child, remove it,except body,as well.( #5416 )
     730                                                // If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289)
    731731                                                var parent = table.getParent();
    732                                                 if ( parent.getChildCount() == 1 && parent.getName() != 'body' )
     732                                                if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )
    733733                                                        parent.remove();
    734734                                                else
    735735                                                        table.remove();
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy