ソースを参照

Adjustments to new data#ready event.

Krzysztof Krztoń 6 年 前
コミット
f4a70a8ca8

+ 1 - 4
packages/ckeditor5-editor-balloon/src/ballooneditor.js

@@ -190,10 +190,7 @@ export default class BalloonEditor extends Editor {
 
 						return editor.data.init( initialData );
 					} )
-					.then( () => {
-						editor.fire( 'dataReady' );
-						editor.fire( 'ready' );
-					} )
+					.then( () => editor.fire( 'ready' ))
 					.then( () => editor )
 			);
 		} );

+ 2 - 24
packages/ckeditor5-editor-balloon/tests/ballooneditor.js

@@ -209,7 +209,7 @@ describe( 'BalloonEditor', () => {
 				init() {
 					this.editor.plugins.on( 'ready', spy );
 					this.editor.ui.on( 'ready', spy );
-					this.editor.on( 'dataReady', spy );
+					this.editor.data.on( 'ready', spy );
 					this.editor.on( 'ready', spy );
 				}
 			}
@@ -220,29 +220,7 @@ describe( 'BalloonEditor', () => {
 				} )
 				.then( newEditor => {
 					expect( fired ).to.deep.equal(
-						[ 'ready-plugincollection', 'ready-ballooneditorui', 'dataReady-ballooneditor', 'ready-ballooneditor' ] );
-
-					editor = newEditor;
-				} );
-		} );
-
-		it( 'fires dataReady once data is loaded', () => {
-			let data;
-
-			class EventWatcher extends Plugin {
-				init() {
-					this.editor.on( 'dataReady', () => {
-						data = this.editor.getData();
-					} );
-				}
-			}
-
-			return BalloonEditor
-				.create( editorElement, {
-					plugins: [ EventWatcher, Paragraph, Bold ]
-				} )
-				.then( newEditor => {
-					expect( data ).to.equal( '<p><strong>foo</strong> bar</p>' );
+						[ 'ready-plugincollection', 'ready-ballooneditorui', 'ready-datacontroller', 'ready-ballooneditor' ] );
 
 					editor = newEditor;
 				} );

+ 0 - 1
packages/ckeditor5-editor-balloon/tests/ballooneditorui.js

@@ -168,7 +168,6 @@ class VirtualBalloonTestEditor extends VirtualTestEditor {
 				editor.initPlugins()
 					.then( () => {
 						editor.ui.init();
-						editor.fire( 'dataReady' );
 						editor.fire( 'ready' );
 					} )
 					.then( () => editor )