Ticket #6289: 6289.patch
File 6289.patch, 1.3 KB (added by , 13 years ago) |
---|
-
_source/plugins/tabletools/plugin.js
714 714 { 715 715 exec : function( editor ) 716 716 { 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 ); 720 720 721 721 if ( !table ) 722 722 return; … … 727 727 range.collapse(); 728 728 selection.selectRanges( [ range ] ); 729 729 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) 731 731 var parent = table.getParent(); 732 if ( parent.getChildCount() == 1 && parent.getName() != 'body')732 if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) ) 733 733 parent.remove(); 734 734 else 735 735 table.remove();