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

Revert "Merge pull request #277 from ckeditor/i/6422"

This reverts commit f1a270d51c2a586c8ba124c7678e46ff8f2dbfb4, reversing
changes made to abe9d05110025616a1a80cd940bf89282ed89cb0.
Aleksander Nowodzinski 5 лет назад
Родитель
Сommit
d79392b99b

+ 1 - 2
packages/ckeditor5-table/src/tableutils.js

@@ -561,8 +561,7 @@ export default class TableUtils extends Plugin {
 	 */
 	getRows( table ) {
 		return [ ...table.getChildren() ].reduce( ( rows, row ) => {
-			const firstCell = row.getChild( 0 );
-			const currentRowCount = firstCell ? parseInt( firstCell.getAttribute( 'rowspan' ) || 1 ) : 0;
+			const currentRowCount = parseInt( row.getChild( 0 ).getAttribute( 'rowspan' ) || 1 );
 
 			return rows + currentRowCount;
 		}, 0 );

+ 0 - 10
packages/ckeditor5-table/tests/commands/removerowcommand.js

@@ -86,16 +86,6 @@ describe( 'RemoveRowCommand', () => {
 
 			expect( command.isEnabled ).to.be.false;
 		} );
-
-		it( 'should work return a proper value even if there\'s empty row in model', () => {
-			setData( model, modelTable( [
-				[ '00', '01[]' ],
-				[ '10', '11' ],
-				[]
-			] ) );
-
-			expect( command.isEnabled ).to.be.true;
-		} );
 	} );
 
 	describe( 'execute()', () => {

+ 0 - 9
packages/ckeditor5-table/tests/tableutils.js

@@ -728,14 +728,5 @@ describe( 'TableUtils', () => {
 
 			expect( tableUtils.getRows( root.getNodeByPath( [ 0 ] ) ) ).to.equal( 4 );
 		} );
-
-		it( 'should work correctly with rows containing no cells', () => {
-			setData( model, modelTable( [
-				[ '00', '01' ],
-				[]
-			] ) );
-
-			expect( tableUtils.getRows( root.getNodeByPath( [ 0 ] ) ) ).to.equal( 1 );
-		} );
 	} );
 } );