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

Used getItemsFromConfig to bootstrap the toolbar in ClassicEditorUI.

Aleksander Nowodzinski 9 лет назад
Родитель
Сommit
28c4f64e4e
1 измененных файлов с 2 добавлено и 3 удалено
  1. 2 3
      packages/ckeditor5-editor-classic/src/classiceditorui.js

+ 2 - 3
packages/ckeditor5-editor-classic/src/classiceditorui.js

@@ -9,6 +9,7 @@
 
 
 import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory';
 import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory';
 import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
 import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
+import { getItemsFromConfig } from '@ckeditor/ckeditor5-ui/src/toolbar/utils';
 
 
 /**
 /**
  * The classic editor UI class.
  * The classic editor UI class.
@@ -83,9 +84,7 @@ export default class ClassicEditorUI {
 				const promises = [];
 				const promises = [];
 
 
 				if ( toolbarConfig ) {
 				if ( toolbarConfig ) {
-					for ( let name of toolbarConfig ) {
-						promises.push( this.view.toolbar.items.add( this.componentFactory.create( name ) ) );
-					}
+					promises.push( getItemsFromConfig( toolbarConfig, this.view.toolbar.items, this.componentFactory ) );
 				}
 				}
 
 
 				return Promise.all( promises );
 				return Promise.all( promises );