Procházet zdrojové kódy

Merge pull request #25 from ckeditor/t/ckeditor5/211

Changed const to lower case.
Szymon Cofalik před 9 roky
rodič
revize
7913aed9e4
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      packages/ckeditor5-typing/src/typing.js

+ 4 - 4
packages/ckeditor5-typing/src/typing.js

@@ -177,13 +177,13 @@ class MutationHandler {
 			const viewPos = new ViewPosition( mutation.node, change.index );
 			const modelPos = this.editing.mapper.toModelPosition( viewPos );
 
-			if ( change.type == 'INSERT' ) {
+			if ( change.type == 'insert' ) {
 				const insertedText = change.values.join( '' );
 
 				this._insert( modelPos, insertedText );
 
 				this.selectionPosition = ModelPosition.createAt( modelPos.parent, modelPos.offset + insertedText.length );
-			} else /* if ( change.type == 'DELETE' ) */ {
+			} else /* if ( change.type == 'delete' ) */ {
 				this._remove( new ModelRange( modelPos, modelPos.getShiftedBy( change.howMany ) ), change.howMany );
 
 				this.selectionPosition = modelPos;
@@ -205,7 +205,7 @@ class MutationHandler {
 		const diffResult = diff( mutation.oldChildren, mutation.newChildren, compare );
 		const changes = diffToChanges( diffResult, mutation.newChildren );
 
-		// In case of [ REMOVE, INSERT, INSERT ] the previous check will not exit.
+		// In case of [ delete, insert, insert ] the previous check will not exit.
 		if ( changes.length > 1 ) {
 			return;
 		}
@@ -222,7 +222,7 @@ class MutationHandler {
 
 		this._insert( modelPos, insertedText );
 
-		this.selectionPosition = ModelPosition.createAt( modelPos.parent, 'END' );
+		this.selectionPosition = ModelPosition.createAt( modelPos.parent, 'end' );
 
 		function compare( oldChild, newChild ) {
 			if ( oldChild instanceof ViewText && newChild instanceof ViewText ) {