瀏覽代碼

Merge pull request #409 from ckeditor/t/ckeditor5-core/64

Docs: Aligned the `BootstrapEditor` to changes related to base `Editor` class and interfaces (`EditorWithUI` and `ElementApi`).
Piotrek Koszuliński 7 年之前
父節點
當前提交
0b00caea2c

+ 6 - 2
packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js

@@ -50,7 +50,7 @@ export default class BootstrapEditor extends Editor {
 		super( config );
 
 		// Remember the element the editor is created with.
-		this.element = element;
+		this.sourceElement = element;
 
 		// Use the HTML data processor in this editor.
 		this.data.processor = new HtmlDataProcessor();
@@ -69,9 +69,13 @@ export default class BootstrapEditor extends Editor {
 		this._elementReplacer = new ElementReplacer();
 	}
 
+	get element() {
+		return this.ui.view.element;
+	}
+
 	destroy() {
 		// When destroyed, editor sets the output of editor#getData() into editor#element...
-		this.updateElement();
+		this.updateSourceElement();
 
 		// ...and restores the original editor#element...
 		this._elementReplacer.restore();

+ 6 - 2
packages/ckeditor5-ui/docs/framework/guides/external-ui.md

@@ -68,7 +68,7 @@ export default class BootstrapEditor extends Editor {
 		super( config );
 
 		// Remember the element the editor is created with.
-		this.element = element;
+		this.sourceElement = element;
 
 		// Use the HTML data processor in this editor.
 		this.data.processor = new HtmlDataProcessor();
@@ -87,9 +87,13 @@ export default class BootstrapEditor extends Editor {
 		this._elementReplacer = new ElementReplacer();
 	}
 
+	get element() {
+		return this.ui.view.element;
+	}
+
 	destroy() {
 		// When destroyed, the editor sets the output of editor#getData() into editor#element...
-		this.updateElement();
+		this.updateSourceElement();
 
 		// ...and restores the original editor#element...
 		this._elementReplacer.restore();