浏览代码

Used new Template API across the project.

Aleksander Nowodzinski 9 年之前
父节点
当前提交
03d397db66

+ 3 - 2
packages/ckeditor5-ui/src/editableui/editableuiview.js

@@ -6,6 +6,7 @@
 'use strict';
 'use strict';
 
 
 import View from '../view.js';
 import View from '../view.js';
+import Template from '/ckeditor5/ui/template.js';
 
 
 /**
 /**
  * @memberOf ui.editableUI
  * @memberOf ui.editableUI
@@ -29,7 +30,7 @@ export default class EditableUIView extends View {
 			this.element = this.editableElement = editableElement;
 			this.element = this.editableElement = editableElement;
 		}
 		}
 
 
-		this.template = {
+		this.template = new Template( {
 			tag: 'div',
 			tag: 'div',
 			attributes: {
 			attributes: {
 				class: [
 				class: [
@@ -38,7 +39,7 @@ export default class EditableUIView extends View {
 				],
 				],
 				contenteditable: bind.to( 'isReadOnly', value => !value ),
 				contenteditable: bind.to( 'isReadOnly', value => !value ),
 			}
 			}
-		};
+		} );
 
 
 		/**
 		/**
 		 * The element which is the main editable element (usually the one with `contentEditable="true"`).
 		 * The element which is the main editable element (usually the one with `contentEditable="true"`).

+ 3 - 2
packages/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js

@@ -7,6 +7,7 @@
 
 
 import EditorUIView from '../../editorui/editoruiview.js';
 import EditorUIView from '../../editorui/editoruiview.js';
 import uid from '../../../utils/uid.js';
 import uid from '../../../utils/uid.js';
+import Template from '/ckeditor5/ui/template.js';
 
 
 /**
 /**
  * Boxed editor UI view.
  * Boxed editor UI view.
@@ -27,7 +28,7 @@ export default class BoxedEditorUIView extends EditorUIView {
 		const t = this.t;
 		const t = this.t;
 		const ariaLabelUid = uid();
 		const ariaLabelUid = uid();
 
 
-		this.template = {
+		this.template = new Template( {
 			tag: 'div',
 			tag: 'div',
 
 
 			attributes: {
 			attributes: {
@@ -69,7 +70,7 @@ export default class BoxedEditorUIView extends EditorUIView {
 					}
 					}
 				}
 				}
 			]
 			]
-		};
+		} );
 
 
 		this.register( 'top', '.ck-editor__top' );
 		this.register( 'top', '.ck-editor__top' );
 		this.register( 'main', '.ck-editor__main' );
 		this.register( 'main', '.ck-editor__main' );

+ 3 - 2
packages/ckeditor5-ui/src/iconmanagerview.js

@@ -6,6 +6,7 @@
 'use strict';
 'use strict';
 
 
 import View from './view.js';
 import View from './view.js';
+import Template from '/ckeditor5/ui/template.js';
 
 
 /**
 /**
  * Icon manager view using {@link ui.iconManager.IconManagerModel}.
  * Icon manager view using {@link ui.iconManager.IconManagerModel}.
@@ -18,13 +19,13 @@ export default class IconManagerView extends View {
 	constructor( model, locale ) {
 	constructor( model, locale ) {
 		super( model, locale );
 		super( model, locale );
 
 
-		this.template = {
+		this.template = new Template( {
 			tag: 'svg',
 			tag: 'svg',
 			ns: 'http://www.w3.org/2000/svg',
 			ns: 'http://www.w3.org/2000/svg',
 			attributes: {
 			attributes: {
 				class: 'ck-icon-manager-sprite'
 				class: 'ck-icon-manager-sprite'
 			}
 			}
-		};
+		} );
 	}
 	}
 
 
 	init() {
 	init() {

+ 3 - 2
packages/ckeditor5-ui/tests/region.js

@@ -10,6 +10,7 @@
 
 
 import Region from '/ckeditor5/ui/region.js';
 import Region from '/ckeditor5/ui/region.js';
 import View from '/ckeditor5/ui/view.js';
 import View from '/ckeditor5/ui/view.js';
+import Template from '/ckeditor5/ui/template.js';
 
 
 let TestViewA, TestViewB;
 let TestViewA, TestViewB;
 let region, el;
 let region, el;
@@ -121,14 +122,14 @@ function createRegionInstance() {
 	class A extends View {
 	class A extends View {
 		constructor() {
 		constructor() {
 			super();
 			super();
-			this.template = { tag: 'a' };
+			this.template = new Template( { tag: 'a' } );
 		}
 		}
 	}
 	}
 
 
 	class B extends View {
 	class B extends View {
 		constructor() {
 		constructor() {
 			super();
 			super();
-			this.template = { tag: 'b' };
+			this.template = new Template( { tag: 'b' } );
 		}
 		}
 	}
 	}