|
|
@@ -77,7 +77,7 @@ export default class TableNavigation extends Plugin {
|
|
|
|
|
|
/**
|
|
|
* Returns a handler for {@link module:engine/view/document~Document#event:keydown keydown} events for the <kbd>Tab</kbd> key executed
|
|
|
- * inside table cell.
|
|
|
+ * inside table cells.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {Boolean} isForward Whether this handler will move the selection to the next or the previous cell.
|
|
|
@@ -170,11 +170,11 @@ export default class TableNavigation extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Handles arrow keys to move the selection around a table.
|
|
|
+ * Handles arrow keys to move the selection around the table.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {'left'|'up'|'right'|'down'} direction The direction of the arrow key.
|
|
|
- * @returns {Boolean} Returns `true` if key was handled.
|
|
|
+ * @returns {Boolean} Returns `true` if the key was handled.
|
|
|
*/
|
|
|
_handleArrowKeys( direction ) {
|
|
|
const model = this.editor.model;
|
|
|
@@ -250,7 +250,7 @@ export default class TableNavigation extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Returns true if the selection is at the boundary of a table cell according to the navigation direction.
|
|
|
+ * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {module:engine/model/selection~Selection} selection The current selection.
|
|
|
@@ -279,12 +279,12 @@ export default class TableNavigation extends Plugin {
|
|
|
|
|
|
/**
|
|
|
* Checks if there is an {@link module:engine/model/element~Element element} next to the current
|
|
|
- * {@link module:engine/model/selection~Selection model selection} marked in
|
|
|
+ * {@link module:engine/model/selection~Selection model selection} marked in the
|
|
|
* {@link module:engine/model/schema~Schema schema} as an `object`.
|
|
|
*
|
|
|
* @private
|
|
|
* @param {module:engine/model/selection~Selection} modelSelection The selection.
|
|
|
- * @param {Boolean} isForward Direction of checking.
|
|
|
+ * @param {Boolean} isForward The direction of checking.
|
|
|
* @returns {Boolean}
|
|
|
*/
|
|
|
_isObjectElementNextToSelection( modelSelection, isForward ) {
|
|
|
@@ -300,12 +300,12 @@ export default class TableNavigation extends Plugin {
|
|
|
|
|
|
/**
|
|
|
* Truncates the range so that it spans from the last selection position
|
|
|
- * to the last allowed $text position (mirrored if isForward is false).
|
|
|
+ * to the last allowed `$text` position (mirrored if `isForward` is false).
|
|
|
*
|
|
|
- * Returns `null` if resulting range can't contain $text element (according to schema).
|
|
|
+ * Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.
|
|
|
*
|
|
|
* @private
|
|
|
- * @param {module:engine/model/range~Range} range Current table cell content range.
|
|
|
+ * @param {module:engine/model/range~Range} range The current table cell content range.
|
|
|
* @param {module:engine/model/selection~Selection} selection The current selection.
|
|
|
* @param {Boolean} isForward The expected navigation direction.
|
|
|
* @returns {module:engine/model/range~Range|null}
|
|
|
@@ -335,13 +335,13 @@ export default class TableNavigation extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Basing on provided range, finds first/last (depending on `direction`) position inside the range
|
|
|
+ * Basing on the provided range, finds the first or last (depending on `direction`) position inside the range
|
|
|
* that can contain `$text` (according to schema) and is visible in the view.
|
|
|
*
|
|
|
* @private
|
|
|
- * @param {module:engine/model/range~Range} range The range to find position in.
|
|
|
+ * @param {module:engine/model/range~Range} range The range to find the position in.
|
|
|
* @param {'forward'|'backward'} direction Search direction.
|
|
|
- * @returns {module:engine/model/position~Position} Nearest selection range.
|
|
|
+ * @returns {module:engine/model/position~Position} The nearest selection range.
|
|
|
*/
|
|
|
_getNearestVisibleTextPosition( range, direction ) {
|
|
|
const schema = this.editor.model.schema;
|
|
|
@@ -359,11 +359,11 @@ export default class TableNavigation extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Checks if the DOM range corresponding to provided model range renders as a single line by analyzing DOMRects
|
|
|
+ * Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects
|
|
|
* (verifying if they visually wrap content to the next line).
|
|
|
*
|
|
|
* @private
|
|
|
- * @param {module:engine/model/range~Range} modelRange Current table cell content range.
|
|
|
+ * @param {module:engine/model/range~Range} modelRange The current table cell content range.
|
|
|
* @param {Boolean} isForward The expected navigation direction.
|
|
|
* @returns {Boolean}
|
|
|
*/
|
|
|
@@ -417,7 +417,7 @@ export default class TableNavigation extends Plugin {
|
|
|
*
|
|
|
* @private
|
|
|
* @param {module:engine/model/element~Element} tableCell The table cell to start the selection navigation.
|
|
|
- * @param {'left'|'up'|'right'|'down'} direction Direction in which selection should move.
|
|
|
+ * @param {'left'|'up'|'right'|'down'} direction The direction in which selection should move.
|
|
|
*/
|
|
|
_navigateFromCellInDirection( tableCell, direction ) {
|
|
|
const model = this.editor.model;
|
|
|
@@ -480,7 +480,7 @@ export default class TableNavigation extends Plugin {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// Returns 'true' if provided key code represents one of the arrow keys.
|
|
|
+// Returns `true` if the provided key code represents one of the arrow keys.
|
|
|
//
|
|
|
// @private
|
|
|
// @param {Number} keyCode
|
|
|
@@ -492,7 +492,7 @@ function isArrowKeyCode( keyCode ) {
|
|
|
keyCode == keyCodes.arrowdown;
|
|
|
}
|
|
|
|
|
|
-// Returns direction name from `keyCode`.
|
|
|
+// Returns the direction name from `keyCode`.
|
|
|
//
|
|
|
// @private
|
|
|
// @param {Number} keyCode
|