Przeglądaj źródła

Renamed `PREFIX` and `EXTENSION` to lower case.

Oskar Wrobel 9 lat temu
rodzic
commit
060cfe773b

+ 1 - 1
packages/ckeditor5-engine/src/model/operation/moveoperation.js

@@ -140,7 +140,7 @@ export default class MoveOperation extends Operation {
 				'operation-move-range-into-itself: Trying to move a range of nodes to the inside of that range.'
 			);
 		} else if ( this.sourcePosition.root == this.targetPosition.root ) {
-			if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'PREFIX' ) {
+			if ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {
 				let i = this.sourcePosition.path.length - 1;
 
 				if ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {

+ 1 - 1
packages/ckeditor5-engine/src/model/operation/transform.js

@@ -322,7 +322,7 @@ const ot = {
 			let aIsInside = rangeB.containsRange( rangeA ) &&
 				( rangeB.containsPosition( a.targetPosition ) || rangeB.start.isEqual( a.targetPosition ) || rangeB.end.isEqual( a.targetPosition ) );
 
-			if ( common !== null && ( aCompB === 'EXTENSION' || ( aCompB === 'SAME' && isStrong ) || aIsInside ) && !bTargetsToA ) {
+			if ( common !== null && ( aCompB === 'extension' || ( aCompB === 'SAME' && isStrong ) || aIsInside ) && !bTargetsToA ) {
 				// Here we do not need to worry that newTargetPosition is inside moved range, because that
 				// would mean that the MoveOperation targets into itself, and that is incorrect operation.
 				// Instead, we calculate the new position of that part of original range.

+ 4 - 4
packages/ckeditor5-engine/src/model/position.js

@@ -151,10 +151,10 @@ export default class Position {
 			case 'SAME':
 				return 'SAME';
 
-			case 'PREFIX':
+			case 'prefix':
 				return 'before';
 
-			case 'EXTENSION':
+			case 'extension':
 				return 'after';
 
 			default:
@@ -221,7 +221,7 @@ export default class Position {
 					transformed.offset -= howMany;
 				}
 			}
-		} else if ( compareArrays( deletePosition.getParentPath(), this.getParentPath() ) == 'PREFIX' ) {
+		} else if ( compareArrays( deletePosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
 			// If nodes are removed from a node that is on a path to this position...
 			const i = deletePosition.path.length - 1;
 
@@ -267,7 +267,7 @@ export default class Position {
 				// "Push" this positions offset.
 				transformed.offset += howMany;
 			}
-		} else if ( compareArrays( insertPosition.getParentPath(), this.getParentPath() ) == 'PREFIX' ) {
+		} else if ( compareArrays( insertPosition.getParentPath(), this.getParentPath() ) == 'prefix' ) {
 			// If nodes are inserted in a node that is on a path to this position...
 			const i = insertPosition.path.length - 1;
 

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

@@ -154,11 +154,11 @@ export default class Position {
 				// No common ancestors found.
 				return 'different';
 
-			case 'PREFIX':
+			case 'prefix':
 				commonAncestorIndex = path.length - 1;
 				break;
 
-			case 'EXTENSION':
+			case 'extension':
 				commonAncestorIndex = otherPath.length - 1;
 				break;