+ function getFocusElementAfterDelCols( cells )\r
+ {\r
+ var cellIndexList = [],\r
+ table = cells[ 0 ] && cells[ 0 ].getAscendant( 'table' ),\r
+ i, length,\r
+ targetIndex, targetCell;\r
+\r
+ // get the cellIndex list of delete cells\r
+ for ( i = 0, length = cells.length; i < length; i++ )\r
+ cellIndexList.push( cells[i].$.cellIndex );\r
+\r
+ // get the focusable column index\r
+ cellIndexList.sort();\r
+ for ( i = 1, length = cellIndexList.length; i < length; i++ )\r
+ {\r
+ if ( cellIndexList[ i ] - cellIndexList[ i - 1 ] > 1 )\r
+ {\r
+ targetIndex = cellIndexList[ i - 1 ] + 1;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if ( !targetIndex )\r
+ targetIndex = cellIndexList[ 0 ] > 0 ? ( cellIndexList[ 0 ] - 1 )\r
+ : ( cellIndexList[ cellIndexList.length - 1 ] + 1 );\r
+\r
+ // scan row by row to get the target cell\r
+ var rows = table.$.rows;\r
+ for ( i = 0, length = rows.length; i < length ; i++ )\r
+ {\r
+ targetCell = rows[ i ].cells[ targetIndex ];\r
+ if ( targetCell )\r
+ break;\r
+ }\r
+\r
+ return targetCell ? new CKEDITOR.dom.element( targetCell ) : table.getPrevious();\r
+ }\r
+\r