8
0
Просмотр исходного кода

Made EditorUIView synchronous.

Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
4013fdb10e

+ 2 - 3
packages/ckeditor5-ui/src/editorui/editoruiview.js

@@ -47,9 +47,8 @@ export default class EditorUIView extends View {
 	 * @inheritDoc
 	 */
 	init() {
-		return Promise.resolve()
-			.then( () => this._renderBodyCollection() )
-			.then( () => super.init() );
+		this._renderBodyCollection();
+		super.init();
 	}
 
 	/**

+ 5 - 9
packages/ckeditor5-ui/tests/editorui/editoruiview.js

@@ -47,18 +47,14 @@ describe( 'EditorUIView', () => {
 		it( 'removes the body region container', () => {
 			const el = view._bodyCollectionContainer;
 
-			return view.destroy().then( () => {
-				expect( el.parentNode ).to.be.null;
-			} );
+			view.destroy();
+			expect( el.parentNode ).to.be.null;
 		} );
 
-		it( 'can be called multiple times', done => {
+		it( 'can be called multiple times', () => {
 			expect( () => {
-				view.destroy().then( () => {
-					return view.destroy().then( () => {
-						done();
-					} );
-				} );
+				view.destroy();
+				view.destroy();
 			} ).to.not.throw();
 		} );
 	} );