- function deleteColumns( selectionOrCell )\r
- {\r
- if ( selectionOrCell instanceof CKEDITOR.dom.selection )\r
- {\r
- var colsToDelete = getSelectedCells( selectionOrCell ),\r
- elementToFocus = getFocusElementAfterDelCols( colsToDelete );\r
-\r
- for ( var i = colsToDelete.length - 1 ; i >= 0 ; i-- )\r
- {\r
- if ( colsToDelete[ i ] )\r
- deleteColumns( colsToDelete[ i ] );\r
- }\r
-\r
- return elementToFocus;\r
- }\r
- else if ( selectionOrCell instanceof CKEDITOR.dom.element )\r
- {\r
- // Get the cell's table.\r
- var table = selectionOrCell.getAscendant( 'table' );\r
- if ( !table )\r
- return null;\r
-\r
- // Get the cell index.\r
- var cellIndex = selectionOrCell.$.cellIndex;\r
-\r
- /*\r
- * Loop through all rows from down to up, coz it's possible that some rows\r
- * will be deleted.\r
- */\r
- for ( i = table.$.rows.length - 1 ; i >= 0 ; i-- )\r
- {\r
- // Get the row.\r
- var row = new CKEDITOR.dom.element( table.$.rows[ i ] );\r
-\r
- // If the cell to be removed is the first one and the row has just one cell.\r
- if ( !cellIndex && row.$.cells.length == 1 )\r
- {\r
- deleteRows( row );\r
- continue;\r
- }\r
-\r
- // Else, just delete the cell.\r
- if ( row.$.cells[ cellIndex ] )\r
- row.$.removeChild( row.$.cells[ cellIndex ] );\r
- }\r
- }\r
-\r
- return null;\r
- }\r
-\r