Explorar el Código

Simplified ui/view class.

Aleksander Nowodzinski hace 10 años
padre
commit
63eeffc24f
Se han modificado 1 ficheros con 5 adiciones y 9 borrados
  1. 5 9
      packages/ckeditor5-engine/src/ui/view.js

+ 5 - 9
packages/ckeditor5-engine/src/ui/view.js

@@ -51,8 +51,11 @@ CKEDITOR.define( [ 'collection', 'model', 'ui/template' ], function( Collection,
 				return this._el;
 			}
 
+			// Render the element using the template.
 			this._el = this.render();
-			this.attachListeners();
+
+			// Attach defined listeners.
+			this.listeners.map( l => l.call( this ) );
 
 			return this._el;
 		}
@@ -89,13 +92,6 @@ CKEDITOR.define( [ 'collection', 'model', 'ui/template' ], function( Collection,
 			};
 		}
 
-		/**
-		 * Attaches view listeners defined in {@link listeners}.
-		 */
-		attachListeners() {
-			this.listeners.map( l => l.call( this ) );
-		}
-
 		/**
 		 * Binds native DOM event listener to View event.
 		 *
@@ -108,7 +104,7 @@ CKEDITOR.define( [ 'collection', 'model', 'ui/template' ], function( Collection,
 		}
 
 		/**
-		 * Renders View's {@link el}.
+		 * Renders View's {@link el} using {@link Template} instance.
 		 *
 		 * @returns {HTMLElement}
 		 */