Kaynağa Gözat

Aligned ContextualToolbar plugin to the View#render API.

Aleksander Nowodzinski 8 yıl önce
ebeveyn
işleme
2608d1455d

+ 3 - 2
packages/ckeditor5-ui/src/toolbar/contextual/contextualtoolbar.js

@@ -7,7 +7,6 @@
  * @module ui/toolbar/contextual/contextualtoolbar
  */
 
-import Template from '../../template';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import ContextualBalloon from '../../panel/balloon/contextualballoon';
 import ToolbarView from '../toolbarview';
@@ -51,7 +50,7 @@ export default class ContextualToolbar extends Plugin {
 		 */
 		this.toolbarView = new ToolbarView( editor.locale );
 
-		Template.extend( this.toolbarView.template, {
+		this.toolbarView.extendTemplate( {
 			attributes: {
 				class: [
 					'ck-editor-toolbar',
@@ -60,6 +59,8 @@ export default class ContextualToolbar extends Plugin {
 			}
 		} );
 
+		this.toolbarView.render();
+
 		/**
 		 * The contextual balloon plugin instance.
 		 *

+ 0 - 2
packages/ckeditor5-ui/tests/toolbar/contextual/contextualtoolbar.js

@@ -44,8 +44,6 @@ describe( 'ContextualToolbar', () => {
 
 				// Focus the engine.
 				editor.editing.view.isFocused = true;
-
-				contextualToolbar.toolbarView.init();
 			} );
 	} );