소스 검색

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();
+					} ) )
+				);
 		}
 	}