Bladeren bron

Changed: Aligned code to changes in ckeditor5-engine.

Szymon Cofalik 8 jaren geleden
bovenliggende
commit
28cf582581

+ 1 - 2
packages/ckeditor5-upload/src/imageuploadprogress.js

@@ -46,8 +46,7 @@ export default class ImageUploadProgress extends Plugin {
 		const editor = this.editor;
 
 		// Upload status change - update image's view according to that status.
-		editor.editing.modelToView.on( 'addAttribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
-		editor.editing.modelToView.on( 'changeAttribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
+		editor.editing.modelToView.on( 'attribute:uploadStatus:image', ( ...args ) => this.uploadStatusChange( ...args ) );
 	}
 
 	/**

+ 3 - 3
packages/ckeditor5-upload/tests/imageuploadengine.js

@@ -197,7 +197,7 @@ describe( 'ImageUploadEngine', () => {
 	} );
 
 	it( 'should not convert image\'s uploadId attribute if is consumed already', () => {
-		editor.editing.modelToView.on( 'addAttribute:uploadId:image', ( evt, data, consumable ) => {
+		editor.editing.modelToView.on( 'attribute:uploadId:image', ( evt, data, consumable ) => {
 			consumable.consume( data.item, eventNameToConsumableType( evt.name ) );
 		}, { priority: 'high' } );
 
@@ -242,7 +242,7 @@ describe( 'ImageUploadEngine', () => {
 				expect( loader.status ).to.equal( 'idle' );
 
 				done();
-			} );
+			}, { priority: 'lowest' } );
 
 			adapterMock.mockSuccess( { default: 'image.png' } );
 		} );
@@ -396,7 +396,7 @@ describe( 'ImageUploadEngine', () => {
 				expect( loader.status ).to.equal( 'idle' );
 
 				done();
-			} );
+			}, { priority: 'lowest' } );
 
 			adapterMock.mockSuccess( { default: 'image.png', 500: 'image-500.png', 800: 'image-800.png' } );
 		} );

+ 4 - 4
packages/ckeditor5-upload/tests/imageuploadprogress.js

@@ -97,7 +97,7 @@ describe( 'ImageUploadProgress', () => {
 			);
 
 			done();
-		} );
+		}, { priority: 'lowest' } );
 
 		nativeReaderMock.mockSuccess( base64Sample );
 	} );
@@ -117,7 +117,7 @@ describe( 'ImageUploadProgress', () => {
 			);
 
 			done();
-		} );
+		}, { priority: 'lowest' } );
 
 		nativeReaderMock.mockSuccess( base64Sample );
 	} );
@@ -135,7 +135,7 @@ describe( 'ImageUploadProgress', () => {
 				);
 
 				done();
-			} );
+			}, { priority: 'lowest' } );
 
 			adapterMock.mockSuccess( { default: 'image.png' } );
 		} );
@@ -158,7 +158,7 @@ describe( 'ImageUploadProgress', () => {
 	} );
 
 	it( 'should not process attribute change if it is already consumed', () => {
-		editor.editing.modelToView.on( 'addAttribute:uploadStatus:image', ( evt, data, consumable ) => {
+		editor.editing.modelToView.on( 'attribute:uploadStatus:image', ( evt, data, consumable ) => {
 			consumable.consume( data.item, eventNameToConsumableType( evt.name ) );
 		}, { priority: 'highest' } );