Răsfoiți Sursa

Minor typos in docs and code style.

Szymon Cofalik 7 ani în urmă
părinte
comite
a994746c68

+ 1 - 1
packages/ckeditor5-table/src/commands/mergecellcommand.js

@@ -81,7 +81,7 @@ export default class MergeCellCommand extends Command {
 	}
 	}
 
 
 	/**
 	/**
-	 * Returns a cell that it mergeable with current cell depending on command's direction.
+	 * Returns a cell that is mergeable with current cell depending on command's direction.
 	 *
 	 *
 	 * @returns {module:engine/model/element|undefined}
 	 * @returns {module:engine/model/element|undefined}
 	 * @private
 	 * @private

+ 0 - 1
packages/ckeditor5-table/src/tableediting.js

@@ -56,7 +56,6 @@ export default class TablesEditing extends Plugin {
 
 
 		schema.register( 'tableRow', {
 		schema.register( 'tableRow', {
 			allowIn: 'table',
 			allowIn: 'table',
-			allowAttributes: [],
 			isBlock: true,
 			isBlock: true,
 			isLimit: true
 			isLimit: true
 		} );
 		} );

+ 3 - 3
packages/ckeditor5-table/src/tableutils.js

@@ -134,7 +134,7 @@ export default class TableUtils extends Plugin {
 		model.change( writer => {
 		model.change( writer => {
 			const tableColumns = this.getColumns( table );
 			const tableColumns = this.getColumns( table );
 
 
-			// Inserting at the end and at the begging of a table doesn't require to calculate anything special.
+			// Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
 			if ( insertAt === 0 || tableColumns <= insertAt ) {
 			if ( insertAt === 0 || tableColumns <= insertAt ) {
 				for ( const tableRow of table.getChildren() ) {
 				for ( const tableRow of table.getChildren() ) {
 					createCells( columns, writer, Position.createAt( tableRow, insertAt ? 'end' : 0 ) );
 					createCells( columns, writer, Position.createAt( tableRow, insertAt ? 'end' : 0 ) );
@@ -208,8 +208,8 @@ export default class TableUtils extends Plugin {
 			const attributes = {};
 			const attributes = {};
 
 
 			if ( cellColspan >= numberOfCells ) {
 			if ( cellColspan >= numberOfCells ) {
-				// If the colspan is bigger then requied cells to create we don't need to update colspan on cells from the same column.
-				// The colspan will be equally devided for newly created cells and a current one.
+				// If the colspan is bigger than or equal to required cells to create we don't need to update colspan on
+				// cells from the same column. The colspan will be equally divided for newly created cells and a current one.
 				const colspanOfInsertedCells = Math.floor( cellColspan / numberOfCells );
 				const colspanOfInsertedCells = Math.floor( cellColspan / numberOfCells );
 				const newColspan = ( cellColspan - colspanOfInsertedCells * numberOfCells ) + colspanOfInsertedCells;
 				const newColspan = ( cellColspan - colspanOfInsertedCells * numberOfCells ) + colspanOfInsertedCells;
 
 

+ 5 - 5
packages/ckeditor5-table/src/tablewalker.js

@@ -21,7 +21,7 @@ export default class TableWalker {
 	 *
 	 *
 	 *		const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
 	 *		const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );
 	 *
 	 *
-	 *		for( const cellInfo of tableWalker ) {
+	 *		for ( const cellInfo of tableWalker ) {
 	 *			console.log( 'A cell at row ' + cellInfo.row + ' and column ' + cellInfo.column );
 	 *			console.log( 'A cell at row ' + cellInfo.row + ' and column ' + cellInfo.column );
 	 *		}
 	 *		}
 	 *
 	 *
@@ -29,7 +29,7 @@ export default class TableWalker {
 	 *
 	 *
 	 *		+----+----+----+----+----+----+
 	 *		+----+----+----+----+----+----+
 	 *		| 00      | 02 | 03      | 05 |
 	 *		| 00      | 02 | 03      | 05 |
-	 *		|         +--- +----+----+----+
+	 *		|         +----+----+----+----+
 	 *		|         | 12      | 14 | 15 |
 	 *		|         | 12      | 14 | 15 |
 	 *		|         +----+----+----+----+
 	 *		|         +----+----+----+----+
 	 *		|         | 22                |
 	 *		|         | 22                |
@@ -46,10 +46,10 @@ export default class TableWalker {
 	 *
 	 *
 	 *	To iterate over spanned cells also:
 	 *	To iterate over spanned cells also:
 	 *
 	 *
-	 *		const tableWalker = new TableWalker( table, { startRow: 1, endRow: 1 } );
+	 *		const tableWalker = new TableWalker( table, { startRow: 1, endRow: 1, includeSpanned: true } );
 	 *
 	 *
-	 *		for( const cellInfo of tableWalker ) {
-	 *			console.log( 'Cell at ' + cellInfo.row + ' x ' + cellInfo.column + ' : ' + ( cellInfo.cell ? 'has data' : 'is spanned' )  );
+	 *		for ( const cellInfo of tableWalker ) {
+	 *			console.log( 'Cell at ' + cellInfo.row + ' x ' + cellInfo.column + ' : ' + ( cellInfo.cell ? 'has data' : 'is spanned' ) );
 	 *		}
 	 *		}
 	 *
 	 *
 	 *	will log in the console for the table from previous example:
 	 *	will log in the console for the table from previous example: