浏览代码

Other: Made code more concise.

Marek Lewandowski 5 年之前
父节点
当前提交
c6254336bb
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      packages/ckeditor5-table/src/commands/removerowcommand.js

+ 1 - 5
packages/ckeditor5-table/src/commands/removerowcommand.js

@@ -105,11 +105,7 @@ export default class RemoveRowCommand extends Command {
 
 // Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.
 function getCellToFocus( table, removedRowIndex, columnToFocus ) {
-	let row = table.getChild( removedRowIndex );
-
-	if ( !row ) {
-		row = table.getChild( table.childCount - 1 );
-	}
+	const row = table.getChild( removedRowIndex ) || table.getChild( table.childCount - 1 );
 
 	// Default to first table cell.
 	let cellToFocus = row.getChild( 0 );