Skip to content

Commit

Permalink
Minor changes, use node#equals to check if parent is an editable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Jun 25, 2014
1 parent 300d441 commit f346804
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/table/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ CKEDITOR.plugins.add( 'table', {
if ( !table )
return;

// If the table's parent has only one child remove it as well (unless it's the body, or a table cell, or the editable element) (#5416, #6289)
var parent = table.getParent();
if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) && !parent.isEditable() )
// If the table's parent has only one child remove it as well (unless it's a table cell, or the editable element) (#5416, #6289, #12110)
var parent = table.getParent(),
editable = editor.editable();

if ( parent.getChildCount() == 1 && !parent.is( 'td', 'th' ) && !editable.equals( editable ) )
table = parent;

var range = editor.createRange();
Expand Down

0 comments on commit f346804

Please sign in to comment.