浏览代码

Aligned heading 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 年之前
父节点
当前提交
61f6e529b1
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 1 2
      packages/ckeditor5-heading/src/heading.js
  2. 3 0
      packages/ckeditor5-heading/tests/heading.js

+ 1 - 2
packages/ckeditor5-heading/src/heading.js

@@ -13,7 +13,6 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Model from '@ckeditor/ckeditor5-ui/src/model';
 import createListDropdown from '@ckeditor/ckeditor5-ui/src/dropdown/list/createlistdropdown';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
-import Template from '@ckeditor/ckeditor5-ui/src/template';
 
 import '../theme/theme.scss';
 
@@ -98,7 +97,7 @@ export default class Heading extends Plugin {
 		editor.ui.componentFactory.add( 'headings', locale => {
 			const dropdown = createListDropdown( dropdownModel, locale );
 
-			Template.extend( dropdown.template, {
+			dropdown.extendTemplate( {
 				attributes: {
 					class: [
 						'ck-heading-dropdown'

+ 3 - 0
packages/ckeditor5-heading/tests/heading.js

@@ -92,6 +92,9 @@ describe( 'Heading', () => {
 
 		it( 'should add custom CSS class to dropdown', () => {
 			const dropdown = editor.ui.componentFactory.create( 'headings' );
+
+			dropdown.render();
+
 			expect( dropdown.element.classList.contains( 'ck-heading-dropdown' ) ).to.be.true;
 		} );