JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.3
[ckeditor.git] / _source / plugins / tabletools / plugin.js
index cacc8cf..b92fb05 100644 (file)
@@ -795,18 +795,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                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