8
0
Просмотр исходного кода

Other: Made code more concise.

Marek Lewandowski 5 лет назад
Родитель
Сommit
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 );