Răsfoiți Sursa

Don't re–initialize model in View's constructor.

Aleksander Nowodzinski 10 ani în urmă
părinte
comite
31d2b4467a

+ 10 - 0
packages/ckeditor5-engine/src/ui/controller.js

@@ -13,9 +13,19 @@ CKEDITOR.define( [ 'collection', 'model' ], function( Collection, Model ) {
 		constructor( model, view ) {
 			super();
 
+			/**
+			 * Model of this controller.
+			 */
 			this.model = model;
+
+			/**
+			 * View of this controller.
+			 */
 			this.view = view;
 
+			/**
+			 * A collection of child controllers.
+			 */
 			this.controllers = new Collection();
 		}
 

+ 1 - 1
packages/ckeditor5-engine/src/ui/view.js

@@ -34,7 +34,7 @@ CKEDITOR.define( [
 			/**
 			 * Model of this view.
 			 */
-			this.model = new Model( model );
+			this.model = model;
 
 			/**
 			 * Regions which belong to this view.