X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Ftabletools%2Fplugin.js;h=b92fb05baa9fbffe3d899e5382042f98ffb692e6;hp=cacc8cf0ad42fbb2c9384f0dab3148073429c422;hb=4e90e78dc97789709ee7404359a5517540c27553;hpb=8f6c203fdaa543c3bca40baea6ae4ddcdf1a77f5 diff --git a/_source/plugins/tabletools/plugin.js b/_source/plugins/tabletools/plugin.js index cacc8cf..b92fb05 100644 --- a/_source/plugins/tabletools/plugin.js +++ b/_source/plugins/tabletools/plugin.js @@ -795,18 +795,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( !table ) return; - // Maintain the selection point at where the table was deleted. - selection.selectElement( table ); - var range = selection.getRanges()[0]; - range.collapse(); - selection.selectRanges( [ range ] ); - // 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.is( 'body', 'td', 'th' ) ) - parent.remove(); - else - table.remove(); + table = parent; + + var range = new CKEDITOR.dom.range( editor.document ); + range.moveToPosition( table, CKEDITOR.POSITION_BEFORE_START ); + table.remove(); + range.select(); } } );