Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Aligned the upload package to the View#render API.
Browse files Browse the repository at this point in the history
Internal: Aligned the UI to the latest API of the framework (see ckeditor/ckeditor5-ui#262).
  • Loading branch information
oleq authored and oskarwrobel committed Nov 2, 2017
1 parent 557906f commit 6c8ef08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/ui/filedialogbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -151,7 +150,7 @@ class FileInputView extends View {

const bind = this.bindTemplate;

this.template = new Template( {
this.setTemplate( {
tag: 'input',

attributes: {
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/filedialogbuttonview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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', () => {
Expand Down

0 comments on commit 6c8ef08

Please sign in to comment.