JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / plugins / tabletools / plugin.js
index b06f59a..0019a49 100644 (file)
@@ -146,7 +146,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        return;\r
 \r
                // Create a clone of the row.\r
-               var newRow = row.clone( true );\r
+               var newRow = row.clone( 1 );\r
 \r
                insertBefore ?\r
                        newRow.insertBefore( row ) :\r
@@ -216,7 +216,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        {\r
                // Get the cell where the selection is placed in.\r
                var startElement = selection.getStartElement();\r
-               var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true );\r
+               var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 );\r
 \r
                if ( !cell )\r
                        return;\r
@@ -234,7 +234,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        if ( $row.cells.length < ( cellIndex + 1 ) )\r
                                continue;\r
 \r
-                       cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( false );\r
+                       cell = ( new CKEDITOR.dom.element( $row.cells[ cellIndex ] ) ).clone( 0 );\r
 \r
                        if ( !CKEDITOR.env.ie )\r
                                cell.appendBogus();\r
@@ -339,7 +339,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
        function insertCell( selection, insertBefore )\r
        {\r
                var startElement = selection.getStartElement();\r
-               var cell = startElement.getAscendant( 'td', true ) || startElement.getAscendant( 'th', true );\r
+               var cell = startElement.getAscendant( 'td', 1 ) || startElement.getAscendant( 'th', 1 );\r
 \r
                if ( !cell )\r
                        return;\r
@@ -714,9 +714,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                {\r
                                        exec : function( editor )\r
                                        {\r
-                                               var selection = editor.getSelection();\r
-                                               var startElement = selection && selection.getStartElement();\r
-                                               var table = startElement && startElement.getAscendant( 'table', true );\r
+                                               var selection = editor.getSelection(),\r
+                                                       startElement = selection && selection.getStartElement(),\r
+                                                       table = startElement && startElement.getAscendant( 'table', 1 );\r
 \r
                                                if ( !table )\r
                                                        return;\r
@@ -727,9 +727,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                range.collapse();\r
                                                selection.selectRanges( [ range ] );\r
 \r
-                                               // If the table's parent has only one child, remove it,except body,as well.( #5416 )\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.getName() != 'body' )\r
+                                               if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )\r
                                                        parent.remove();\r
                                                else\r
                                                        table.remove();\r