Ticket #6649: 6649.patch

File 6649.patch, 1.0 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/tabletools/plugin.js

     
    721721                                                if ( !table )
    722722                                                        return;
    723723
    724                                                 // Maintain the selection point at where the table was deleted.
    725                                                 selection.selectElement( table );
    726                                                 var range = selection.getRanges()[0];
    727                                                 range.collapse();
    728                                                 selection.selectRanges( [ range ] );
    729 
    730724                                                // If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289)
    731725                                                var parent = table.getParent();
    732726                                                if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )
    733                                                         parent.remove();
    734                                                 else
    735                                                         table.remove();
     727                                                        table = parent;
     728
     729                                                var range = new CKEDITOR.dom.range( editor.document );
     730                                                range.moveToPosition( table, CKEDITOR.POSITION_BEFORE_START );
     731                                                table.remove();
     732                                                range.select();
    736733                                        }
    737734                                } );
    738735
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy