8
0
Просмотр исходного кода

Merge branch 'master' into t/ckeditor5/645

Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
ce6281a85e
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      packages/ckeditor5-typing/tests/deletecommand.js

+ 3 - 6
packages/ckeditor5-typing/tests/deletecommand.js

@@ -244,12 +244,9 @@ describe( 'DeleteCommand', () => {
 		} );
 		} );
 
 
 		it( 'does not replace an element if a paragraph is not allowed in current position', () => {
 		it( 'does not replace an element if a paragraph is not allowed in current position', () => {
-			model.schema.on( 'checkChild', ( evt, args ) => {
-				const def = model.schema.getDefinition( args[ 1 ] );
-
-				if ( args[ 0 ].endsWith( '$root' ) && def.name == 'paragraph' ) {
-					evt.stop();
-					evt.return = false;
+			model.schema.addChildCheck( ( ctx, childDef ) => {
+				if ( ctx.endsWith( '$root' ) && childDef.name == 'paragraph' ) {
+					return false;
 				}
 				}
 			} );
 			} );