瀏覽代碼

Added destruction prcedure to Controller class.

Aleksander Nowodzinski 10 年之前
父節點
當前提交
739be53541
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      packages/ckeditor5-engine/src/ui/controller.js

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

@@ -56,6 +56,15 @@ CKEDITOR.define( [ 'collection', 'model' ], function( Collection, Model ) {
 		 * @returns
 		 */
 		destroy() {
+			return Promise.resolve()
+				.then( () => {
+					return this.view.destroy();
+				} )
+				.then(
+					Promise.all( this.controllers.filter( c => {
+						return c.destroy();
+					} ) )
+				);
 		}
 	}