浏览代码

Renamed templateBind to bindTemplate.

Oskar Wrobel 9 年之前
父节点
当前提交
415b02f3f5

+ 8 - 8
packages/ckeditor5-ui/src/view.js

@@ -73,10 +73,10 @@ export default class View {
 
 		/**
 		 * Cached {@link ui.Template} binder object specific for this instance.
-		 * See {@link ui.View#templateBind}.
+		 * See {@link ui.View#bindTemplate}.
 		 *
 		 * @private
-		 * @member {Object} ui.View.#_templateBind
+		 * @member {Object} ui.View.#_bindTemplate
 		 */
 	}
 
@@ -109,16 +109,16 @@ export default class View {
 	/**
 	 * Shorthand for {@link ui.Template#bind}, bound to {@link ui.View} on the first access.
 	 *
-	 * Cached {@link ui.Template#bind} object is stored in {@link ui.View.#_templateBind}.
+	 * Cached {@link ui.Template#bind} object is stored in {@link ui.View.#_bindTemplate}.
 	 *
-	 * @method ui.View#templateBind
+	 * @method ui.View#bindTemplate
 	 */
-	get templateBind() {
-		if ( this._templateBind ) {
-			return this._templateBind;
+	get bindTemplate() {
+		if ( this._bindTemplate ) {
+			return this._bindTemplate;
 		}
 
-		return ( this._templateBind = Template.bind( this, this ) );
+		return ( this._bindTemplate = Template.bind( this, this ) );
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-ui/tests/controllercollection.js

@@ -522,7 +522,7 @@ function defineItemViewClass() {
 		constructor( locale ) {
 			super( locale );
 
-			const bind = this.templateBind;
+			const bind = this.bindTemplate;
 
 			this.template = new Template( {
 				tag: 'li',

+ 3 - 3
packages/ckeditor5-ui/tests/view.js

@@ -122,10 +122,10 @@ describe( 'View', () => {
 		} );
 
 		it( 'returns a shorthand for Template binding', () => {
-			expect( view.templateBind.to ).to.be.a( 'function' );
-			expect( view.templateBind.if ).to.be.a( 'function' );
+			expect( view.bindTemplate.to ).to.be.a( 'function' );
+			expect( view.bindTemplate.if ).to.be.a( 'function' );
 
-			const binding = view.templateBind.to( 'a' );
+			const binding = view.bindTemplate.to( 'a' );
 
 			expect( binding.observable ).to.equal( view );
 			expect( binding.emitter ).to.equal( view );