Parcourir la source

Changed order in the register function.

Maciej Bukowski il y a 7 ans
Parent
commit
c028a251b8
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      packages/ckeditor5-widget/src/widgettoolbarrepository.js

+ 2 - 2
packages/ckeditor5-widget/src/widgettoolbarrepository.js

@@ -110,8 +110,6 @@ export default class WidgetToolbarRepository extends Plugin {
 		const editor = this.editor;
 		const toolbarView = new ToolbarView();
 
-		toolbarView.fillFromConfig( toolbarItems, editor.ui.componentFactory );
-
 		if ( this._toolbars.has( toolbarId ) ) {
 			/**
 			 * Toolbar with the given id was already added.
@@ -122,6 +120,8 @@ export default class WidgetToolbarRepository extends Plugin {
 			throw new CKEditorError( 'widget-toolbar-duplicated: Toolbar with the given id was already added.', { toolbarId } );
 		}
 
+		toolbarView.fillFromConfig( toolbarItems, editor.ui.componentFactory );
+
 		this._toolbars.set( toolbarId, {
 			view: toolbarView,
 			visibleWhen,