Преглед на файлове

Docs: added/fixed code comments.

Szymon Cofalik преди 9 години
родител
ревизия
4765ae72ac

+ 2 - 2
packages/ckeditor5-engine/src/model/selection.js

@@ -144,9 +144,9 @@ export default class Selection {
 
 		// Every range from this selection...
 		return Array.from( this.getRanges() ).every( ( rangeA ) => {
-			// ...Has a range in other selection...
+			// ... has a range in other selection...
 			return Array.from( otherSelection.getRanges() ).some( ( rangeB ) => {
-				// That it is equal to.
+				// ... which it is equal to.
 				return rangeA.isEqual( rangeB );
 			} );
 		} );

+ 2 - 0
packages/ckeditor5-engine/src/view/observer/selectionobserver.js

@@ -186,6 +186,8 @@ export default class SelectionObserver extends Observer {
 			this._loopbackCounter = 0;
 		}
 
+		// This counter is reset every 2 seconds. 50 selection changes in 2 seconds is enough high number
+		// to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).
 		if ( this._loopbackCounter > 50 ) {
 			return true;
 		}

+ 2 - 2
packages/ckeditor5-engine/src/view/selection.js

@@ -310,9 +310,9 @@ export default class Selection {
 
 		// Every range from this selection...
 		return Array.from( this.getRanges() ).every( ( rangeA ) => {
-			// ...Has a range in other selection...
+			// ... has a range in other selection...
 			return Array.from( otherSelection.getRanges() ).some( ( rangeB ) => {
-				// That it is equal to.
+				// ... which it is equal to.
 				return rangeA.isEqual( rangeB );
 			} );
 		} );