8
0
Quellcode durchsuchen

Docs: Moved the EditorUIView rendering in the external UI guide (and demo) straight to BootstrapEditorUI#init to allow using the "body" view collection.

Aleksander Nowodzinski vor 5 Jahren
Ursprung
Commit
ea481e75ae

+ 4 - 0
packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js

@@ -138,6 +138,10 @@ class BootstrapEditorUI extends EditorUI {
 		const view = this.view;
 		const editingView = editor.editing.view;
 
+		// Make sure the EditorUIView is rendered. This will, for instance, create a place for UI elements
+		// like floating panels detached from the main editor UI in DOM.
+		this._view.render();
+
 		// Create an editing root in the editing layer. It will correspond with the
 		// document root created in the constructor().
 		const editingRoot = editingView.document.getRoot();

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

@@ -255,8 +255,7 @@ class BootstrapEditorUI extends EditorUI {
 
 		// References to the toolbar buttons for further usage. See #_setupBootstrapToolbarButtons.
 		view.toolbarButtons = {};
-		// Render the view to the body.
-		this._view.render();
+
 		[ 'bold', 'italic', 'underline', 'undo', 'redo' ].forEach( name => {
 			// Retrieve the jQuery object corresponding with the button in the DOM.
 			view.toolbarButtons[ name ] = view.element.find( `#${ name }` );
@@ -274,6 +273,10 @@ class BootstrapEditorUI extends EditorUI {
 		const view = this.view;
 		const editingView = editor.editing.view;
 
+		// Make sure the EditorUIView is rendered. This will, for instance, create a place for UI elements
+		// like floating panels detached from the main editor UI in DOM.
+		this._view.render();
+
 		// Create an editing root in the editing layer. It will correspond with the
 		// document root created in the constructor().
 		const editingRoot = editingView.document.getRoot();