Przeglądaj źródła

Merge branch t/ckeditor5-engine/858

Internal: Update API usage after merge t/858 on engine.
Piotr Jasiun 8 lat temu
rodzic
commit
487812a978
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      packages/ckeditor5-enter/src/entercommand.js

+ 2 - 3
packages/ckeditor5-enter/src/entercommand.js

@@ -8,7 +8,6 @@
  */
  */
 
 
 import Command from '@ckeditor/ckeditor5-core/src/command';
 import Command from '@ckeditor/ckeditor5-core/src/command';
-import Position from '@ckeditor/ckeditor5-engine/src/model/position';
 
 
 /**
 /**
  * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
  * Enter command. It is used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> key.
@@ -89,12 +88,12 @@ function splitBlock( batch, selection, splitPos ) {
 		// If the split is at the end of element, instead of splitting, just create a clone of position's parent
 		// If the split is at the end of element, instead of splitting, just create a clone of position's parent
 		// element and insert it after split element. The result is the same but less operations are done
 		// element and insert it after split element. The result is the same but less operations are done
 		// and it's more semantically correct (when it comes to operational transformation).
 		// and it's more semantically correct (when it comes to operational transformation).
-		batch.insert( Position.createAfter( splitPos.parent ), newElement );
+		batch.insert( newElement, splitPos.parent, 'after' );
 	} else if ( splitPos.isAtStart ) {
 	} else if ( splitPos.isAtStart ) {
 		// If the split is at the start of element, instead of splitting, just create a clone of position's parent
 		// If the split is at the start of element, instead of splitting, just create a clone of position's parent
 		// element and insert it before split element. The result is the same but less operations are done
 		// element and insert it before split element. The result is the same but less operations are done
 		// and it's more semantically correct (when it comes to operational transformation).
 		// and it's more semantically correct (when it comes to operational transformation).
-		batch.insert( Position.createBefore( splitPos.parent ), newElement );
+		batch.insert( newElement, splitPos.parent, 'before' );
 	} else {
 	} else {
 		batch.split( splitPos );
 		batch.split( splitPos );
 	}
 	}