Przeglądaj źródła

InputTextViewAligned InputTextView to the View#render API.

Aleksander Nowodzinski 8 lat temu
rodzic
commit
0286fa62d7

+ 8 - 2
packages/ckeditor5-ui/src/inputtext/inputtextview.js

@@ -8,7 +8,6 @@
  */
 
 import View from '../view';
-import Template from '../template';
 
 /**
  * The text input view class.
@@ -56,7 +55,7 @@ export default class InputTextView extends View {
 
 		const bind = this.bindTemplate;
 
-		this.template = new Template( {
+		this.setTemplate( {
 			tag: 'input',
 			attributes: {
 				type: 'text',
@@ -69,6 +68,13 @@ export default class InputTextView extends View {
 				readonly: bind.to( 'isReadOnly' )
 			}
 		} );
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	render() {
+		super.render();
 
 		// Note: `value` cannot be an HTML attribute, because it doesn't change HTMLInputElement value once changed.
 		this.on( 'change:value', ( evt, propertyName, value ) => {

+ 1 - 1
packages/ckeditor5-ui/tests/inputtext/inputtextview.js

@@ -11,7 +11,7 @@ describe( 'InputTextView', () => {
 	beforeEach( () => {
 		view = new InputTextView();
 
-		view.init();
+		view.render();
 	} );
 
 	describe( 'constructor()', () => {