瀏覽代碼

Changed order in the register function.

Maciej Bukowski 7 年之前
父節點
當前提交
c028a251b8
共有 1 個文件被更改,包括 2 次插入2 次删除
  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,