浏览代码

Merge branch t/ckeditor5-engine/1234

Internal: Update API usage after merge t/1234 on engine.
Piotr Jasiun 7 年之前
父节点
当前提交
87f2ae9656
共有 1 个文件被更改,包括 3 次插入6 次删除
  1. 3 6
      packages/ckeditor5-list/tests/listcommand.js

+ 3 - 6
packages/ckeditor5-list/tests/listcommand.js

@@ -33,12 +33,9 @@ describe( 'ListCommand', () => {
 		} );
 		model.schema.register( 'widget', { inheritAllFrom: '$block' } );
 
-		model.schema.on( 'checkChild', ( evt, args ) => {
-			const def = model.schema.getDefinition( args[ 1 ] );
-
-			if ( args[ 0 ].endsWith( 'widget' ) && def.name == 'listItem' ) {
-				evt.stop();
-				evt.return = false;
+		model.schema.addChildCheck( ( ctx, childDef ) => {
+			if ( ctx.endsWith( 'widget' ) && childDef.name == 'listItem' ) {
+				return false;
 			}
 		} );