if ( !table )\r
return;\r
\r
- // Maintain the selection point at where the table was deleted.\r
- selection.selectElement( table );\r
- var range = selection.getRanges()[0];\r
- range.collapse();\r
- selection.selectRanges( [ range ] );\r
-\r
// If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289)\r
var parent = table.getParent();\r
if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )\r
- parent.remove();\r
- else\r
- table.remove();\r
+ table = parent;\r
+\r
+ var range = new CKEDITOR.dom.range( editor.document );\r
+ range.moveToPosition( table, CKEDITOR.POSITION_BEFORE_START );\r
+ table.remove();\r
+ range.select();\r
}\r
} );\r
\r