浏览代码

Aligned BalloonPanelView to the View#render API.

Aleksander Nowodzinski 8 年之前
父节点
当前提交
dfae93d239

+ 4 - 5
packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.js

@@ -8,7 +8,6 @@
  */
 
 import View from '../../view';
-import Template from '../../template';
 import { getOptimalPosition } from '@ckeditor/ckeditor5-utils/src/dom/position';
 import isRange from '@ckeditor/ckeditor5-utils/src/dom/isrange';
 import isElement from '@ckeditor/ckeditor5-utils/src/lib/lodash/isElement';
@@ -40,7 +39,7 @@ const defaultLimiterElement = global.document.body;
  *		const childView = new ChildView();
  *		const positions = BalloonPanelView.defaultPositions;
  *
- *		panel.init();
+ *		panel.render();
  *
  *		// Add a child view to the panel's content collection.
  *		panel.content.add( childView );
@@ -144,7 +143,7 @@ export default class BalloonPanelView extends View {
 		 */
 		this.content = this.createCollection();
 
-		this.template = new Template( {
+		this.setTemplate( {
 			tag: 'div',
 			attributes: {
 				class: [
@@ -194,7 +193,7 @@ export default class BalloonPanelView extends View {
 	 *		const panel = new BalloonPanelView( locale );
 	 *		const positions = BalloonPanelView.defaultPositions;
 	 *
-	 *		panel.init();
+	 *		panel.render();
 	 *
 	 *		// Attach the panel to an element with the "target" id DOM.
 	 *		panel.attachTo( {
@@ -249,7 +248,7 @@ export default class BalloonPanelView extends View {
 	 *		const panel = new BalloonPanelView( locale );
 	 *		const positions = BalloonPanelView.defaultPositions;
 	 *
-	 *		panel.init();
+	 *		panel.render();
 	 *
 	 *		// Pin the panel to an element with the "target" id DOM.
 	 *		panel.pin( {

+ 2 - 3
packages/ckeditor5-ui/tests/panel/balloon/balloonpanelview.js

@@ -18,17 +18,16 @@ describe( 'BalloonPanelView', () => {
 
 	beforeEach( () => {
 		view = new BalloonPanelView();
+		view.render();
 
 		document.body.appendChild( view.element );
-
-		return view.init();
 	} );
 
 	afterEach( () => {
 		if ( view ) {
 			view.element.remove();
 
-			return view.destroy();
+			view.destroy();
 		}
 	} );