Sfoglia il codice sorgente

Removed the Editor part of the fix, which became obsolete.

Aleksander Nowodzinski 8 anni fa
parent
commit
a4d0aa5911

+ 0 - 8
packages/ckeditor5-core/src/editor/editor.js

@@ -89,14 +89,6 @@ export default class Editor {
 		 */
 		this.data = new DataController( this.document );
 
-		// Refresh the state of all editor commands as soon as data is ready.
-		// https://github.com/ckeditor/ckeditor5-core/issues/50
-		this.listenTo( this, 'dataReady', () => {
-			for ( const command of this.commands.values() ) {
-				command.refreshState();
-			}
-		} );
-
 		/**
 		 * Instance of the {@link module:engine/controller/editingcontroller~EditingController editing controller}.
 		 *

+ 0 - 14
packages/ckeditor5-core/tests/editor/editor.js

@@ -107,20 +107,6 @@ describe( 'Editor', () => {
 
 			expect( editor.config.get( 'bar' ) ).to.equal( 'foo' );
 		} );
-
-		// https://github.com/ckeditor/ckeditor5-core/issues/50
-		it( 'should attach #dataReady listener to refresh state of the commands', () => {
-			const editor = new Editor();
-			const command = {
-				refreshState: sinon.spy()
-			};
-
-			editor.commands.set( 'foo', command );
-			editor.commands.set( 'bar', command );
-			editor.fire( 'dataReady' );
-
-			sinon.assert.calledTwice( command.refreshState );
-		} );
 	} );
 
 	describe( 'plugins', () => {