8
0
فهرست منبع

Aligned code to changes in Selection API.

Maciej Bukowski 8 سال پیش
والد
کامیت
a073f3c8ab
2فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 1 1
      packages/ckeditor5-typing/src/deletecommand.js
  2. 2 4
      packages/ckeditor5-typing/tests/input.js

+ 1 - 1
packages/ckeditor5-typing/src/deletecommand.js

@@ -67,7 +67,7 @@ export default class DeleteCommand extends Command {
 		model.enqueueChange( this._buffer.batch, writer => {
 			this._buffer.lock();
 
-			const selection = Selection.createFromSelection( doc.selection );
+			const selection = new Selection( doc.selection );
 
 			// Do not replace the whole selected content if selection was collapsed.
 			// This prevents such situation:

+ 2 - 4
packages/ckeditor5-typing/tests/input.js

@@ -994,8 +994,7 @@ describe( 'Input feature', () => {
 
 			const paragraph = viewRoot.getChild( 0 );
 			const strong = paragraph.getChild( 0 );
-			const viewSelection = new ViewSelection();
-			viewSelection.setTo( paragraph, 0 );
+			const viewSelection = new ViewSelection( paragraph, 0 );
 
 			// Simulate mutations and DOM change.
 			domRoot.childNodes[ 0 ].innerHTML = '<b>textx</b>';
@@ -1019,8 +1018,7 @@ describe( 'Input feature', () => {
 
 			const paragraph = viewRoot.getChild( 0 );
 			const strong = paragraph.getChild( 0 );
-			const viewSelection = new ViewSelection();
-			viewSelection.setTo( paragraph );
+			const viewSelection = new ViewSelection( paragraph );
 
 			// Simulate mutations and DOM change.
 			domRoot.childNodes[ 0 ].innerHTML = '<strong>Foo bar </strong><b>apple</b>';