浏览代码

Draft of the view root destriction.

Aleksander Nowodzinski 7 年之前
父节点
当前提交
80d4fe20cf
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      packages/ckeditor5-editor-inline/src/inlineeditorui.js

+ 8 - 1
packages/ckeditor5-editor-inline/src/inlineeditorui.js

@@ -54,7 +54,7 @@ export default class InlineEditorUI extends EditorUI {
 		view.editable.name = editingRoot.rootName;
 		view.editable.name = editingRoot.rootName;
 
 
 		editor.on( 'dataReady', () => {
 		editor.on( 'dataReady', () => {
-			view.editable.attachDomRootActions();
+			view.editable.enableDomRootActions();
 
 
 			attachPlaceholder( editingView, getPlaceholderElement( editingRoot ), 'Type some text...' );
 			attachPlaceholder( editingView, getPlaceholderElement( editingRoot ), 'Type some text...' );
 		} );
 		} );
@@ -89,6 +89,13 @@ export default class InlineEditorUI extends EditorUI {
 			toolbar: view.toolbar
 			toolbar: view.toolbar
 		} );
 		} );
 	}
 	}
+
+	destroy() {
+		this.view.editable.disableDomRootActions();
+		this.editor.editing.view.detachDomRoots();
+
+		super.destroy();
+	}
 }
 }
 
 
 function getPlaceholderElement( viewRoot ) {
 function getPlaceholderElement( viewRoot ) {