Bladeren bron

Internal: Updated schema use. See ckeditor/ckeditor5-engine#1234.

Piotrek Koszuliński 7 jaren geleden
bovenliggende
commit
087c794ab7
1 gewijzigde bestanden met toevoegingen van 3 en 7 verwijderingen
  1. 3 7
      packages/ckeditor5-basic-styles/tests/attributecommand.js

+ 3 - 7
packages/ckeditor5-basic-styles/tests/attributecommand.js

@@ -33,16 +33,12 @@ describe( 'AttributeCommand', () => {
 					isObject: true
 				} );
 
-				model.schema.on( 'checkAttribute', ( evt, args ) => {
-					const ctx = args[ 0 ];
-					const attributeName = args[ 1 ];
-
+				model.schema.addAttributeCheck( ( ctx, attributeName ) => {
 					// Allow 'bold' on p>$text.
 					if ( ctx.endsWith( 'p $text' ) && attributeName == 'bold' ) {
-						evt.stop();
-						evt.return = true;
+						return true;
 					}
-				}, { priority: 'high' } );
+				} );
 			} );
 	} );