瀏覽代碼

Aligned LabeledInputView to the View#render API.

Aleksander Nowodzinski 8 年之前
父節點
當前提交
b27c7730fe

+ 1 - 2
packages/ckeditor5-ui/src/labeledinput/labeledinputview.js

@@ -8,7 +8,6 @@
  */
 
 import View from '../view';
-import Template from '../template';
 import uid from '@ckeditor/ckeditor5-utils/src/uid';
 
 import LabelView from '../label/labelview';
@@ -70,7 +69,7 @@ export default class LabeledInputView extends View {
 
 		const bind = this.bindTemplate;
 
-		this.template = new Template( {
+		this.setTemplate( {
 			tag: 'div',
 			attributes: {
 				class: [

+ 3 - 3
packages/ckeditor5-ui/tests/labeledinput/labeledinputview.js

@@ -15,7 +15,7 @@ describe( 'LabeledInputView', () => {
 	beforeEach( () => {
 		view = new LabeledInputView( locale, InputView );
 
-		view.init();
+		view.render();
 	} );
 
 	describe( 'constructor()', () => {
@@ -38,11 +38,11 @@ describe( 'LabeledInputView', () => {
 
 	describe( 'template', () => {
 		it( 'should have label view', () => {
-			expect( view.template.children.get( 0 ) ).to.equal( view.labelView );
+			expect( view.template.children[ 0 ] ).to.equal( view.labelView );
 		} );
 
 		it( 'should have input view', () => {
-			expect( view.template.children.get( 1 ) ).to.equal( view.inputView );
+			expect( view.template.children[ 1 ] ).to.equal( view.inputView );
 		} );
 
 		describe( 'DOM bindings', () => {