소스 검색

Clarified API docs.

Piotrek Koszuliński 9 년 전
부모
커밋
e4d1709546
1개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 12 12
      packages/ckeditor5-engine/src/treemodel/selection.js

+ 12 - 12
packages/ckeditor5-engine/src/treemodel/selection.js

@@ -224,7 +224,7 @@ export default class Selection {
 	/**
 	 * Sets collapsed selection in the specified location.
 	 *
-	 * The `location` can be specified as:
+	 * The location can be specified as:
 	 *
 	 * * a {@link engine.treeModel.Position position},
 	 * * parent element and offset (offset defaults to `0`),
@@ -233,10 +233,10 @@ export default class Selection {
 	 *
 	 * @fires {@link engine.treeModel.Selection#change:range change:range}
 	 * @param {engine.treeModel.Node|engine.treeModel.Position} nodeOrPosition
-	 * @param {Number|'END'|'BEFORE'|'AFTER'} [location=0] Offset or one of the flags. Used only when
+	 * @param {Number|'END'|'BEFORE'|'AFTER'} [offset=0] Offset or one of the flags. Used only when
 	 * first parameter is a node.
 	 */
-	collapse( nodeOrPosition, location ) {
+	collapse( nodeOrPosition, offset ) {
 		let node, pos;
 
 		if ( nodeOrPosition instanceof Position ) {
@@ -244,19 +244,19 @@ export default class Selection {
 		} else {
 			node = nodeOrPosition;
 
-			if ( location == 'END' ) {
-				location = node.getChildCount();
-			} else if ( location == 'BEFORE' ) {
-				location = node.getIndex();
+			if ( offset == 'END' ) {
+				offset = node.getChildCount();
+			} else if ( offset == 'BEFORE' ) {
+				offset = node.getIndex();
 				node = node.parent;
-			} else if ( location == 'AFTER' ) {
-				location = node.getIndex() + 1;
+			} else if ( offset == 'AFTER' ) {
+				offset = node.getIndex() + 1;
 				node = node.parent;
-			} else if ( !location ) {
-				location = 0;
+			} else if ( !offset ) {
+				offset = 0;
 			}
 
-			pos = Position.createFromParentAndOffset( node, location );
+			pos = Position.createFromParentAndOffset( node, offset );
 		}
 
 		const range = new Range( pos, pos );