8
0
Просмотр исходного кода

Aligned the upload package to the View#render API.

Internal: Aligned the UI to the latest API of the framework (see ckeditor/ckeditor5-ui#262).
Aleksander Nowodzinski 8 лет назад
Родитель
Сommit
2ab3a945c1

+ 2 - 3
packages/ckeditor5-upload/src/ui/filedialogbuttonview.js

@@ -9,7 +9,6 @@
 
 import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import View from '@ckeditor/ckeditor5-ui/src/view';
-import Template from '@ckeditor/ckeditor5-ui/src/template';
 
 /**
  * The file dialog button view.
@@ -93,7 +92,7 @@ export default class FileDialogButtonView extends View {
 		 */
 		this._fileInputView.delegate( 'done' ).to( this );
 
-		this.template = new Template( {
+		this.setTemplate( {
 			tag: 'span',
 			attributes: {
 				class: 'ck-file-dialog-button',
@@ -151,7 +150,7 @@ class FileInputView extends View {
 
 		const bind = this.bindTemplate;
 
-		this.template = new Template( {
+		this.setTemplate( {
 			tag: 'input',
 
 			attributes: {

+ 3 - 3
packages/ckeditor5-upload/tests/ui/filedialogbuttonview.js

@@ -14,7 +14,7 @@ describe( 'FileDialogButtonView', () => {
 		localeMock = { t: val => val };
 		view = new FileDialogButtonView( localeMock );
 
-		return view.init();
+		view.render();
 	} );
 
 	it( 'should be rendered from a template', () => {
@@ -25,7 +25,7 @@ describe( 'FileDialogButtonView', () => {
 		describe( 'button view', () => {
 			it( 'should be rendered', () => {
 				expect( view.buttonView ).to.instanceof( ButtonView );
-				expect( view.buttonView ).to.equal( view.template.children.get( 0 ) );
+				expect( view.buttonView ).to.equal( view.template.children[ 0 ] );
 			} );
 
 			it( 'should open file dialog on execute', () => {
@@ -39,7 +39,7 @@ describe( 'FileDialogButtonView', () => {
 		describe( 'file dialog', () => {
 			it( 'should be rendered', () => {
 				expect( view._fileInputView ).to.instanceof( View );
-				expect( view._fileInputView ).to.equal( view.template.children.get( 1 ) );
+				expect( view._fileInputView ).to.equal( view.template.children[ 1 ] );
 			} );
 
 			it( 'should be bound to view#acceptedType', () => {