ソースを参照

Adjustments to new data#ready event.

Krzysztof Krztoń 7 年 前
コミット
4abee3643c

+ 1 - 4
packages/ckeditor5-editor-classic/src/classiceditor.js

@@ -181,10 +181,7 @@ export default class ClassicEditor 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-classic/tests/classiceditor.js

@@ -194,7 +194,7 @@ describe( 'ClassicEditor', () => {
 				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 );
 				}
 			}
@@ -205,29 +205,7 @@ describe( 'ClassicEditor', () => {
 				} )
 				.then( newEditor => {
 					expect( fired ).to.deep.equal(
-						[ 'ready-plugincollection', 'ready-classiceditorui', 'dataReady-classiceditor', 'ready-classiceditor' ] );
-
-					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 ClassicEditor
-				.create( editorElement, {
-					plugins: [ EventWatcher, Paragraph, Bold ]
-				} )
-				.then( newEditor => {
-					expect( data ).to.equal( '<p><strong>foo</strong> bar</p>' );
+						[ 'ready-plugincollection', 'ready-classiceditorui', 'ready-datacontroller', 'ready-classiceditor' ] );
 
 					editor = newEditor;
 				} );

+ 0 - 1
packages/ckeditor5-editor-classic/tests/classiceditorui.js

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