ソースを参照

Merge branch t/ckeditor5-core/110

Internal: Update API usage after merge t/110 on engine.
Piotr Jasiun 8 年 前
コミット
04ce986924

+ 0 - 1
packages/ckeditor5-editor-inline/src/inlineeditor.js

@@ -52,7 +52,6 @@ export default class InlineEditor extends StandardEditor {
 	constructor( element, config ) {
 		super( element, config );
 
-		this.model.document.createRoot();
 		this.data.processor = new HtmlDataProcessor();
 		this.ui = new InlineEditorUI( this, new InlineEditorUIView( this.locale, element ) );
 	}

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

@@ -52,10 +52,6 @@ export default class InlineEditorUI {
 		 * @private
 		 */
 		this._toolbarConfig = normalizeToolbarConfig( editor.config.get( 'toolbar' ) );
-
-		// RootEditableElement should be created together with the editor structure.
-		// See https://github.com/ckeditor/ckeditor5/issues/647.
-		editor.editing.createRoot( view.editableElement );
 	}
 
 	/**
@@ -93,6 +89,7 @@ export default class InlineEditorUI {
 		// Bind to focusTracker instead of editor.editing.view because otherwise
 		// focused editable styles disappear when view#toolbar is focused.
 		view.editable.bind( 'isFocused' ).to( this.focusTracker );
+		editor.editing.view.attachDomRoot( view.editableElement );
 		view.editable.name = editingRoot.rootName;
 
 		this.focusTracker.add( view.editableElement );

+ 0 - 14
packages/ckeditor5-editor-inline/tests/inlineeditor.js

@@ -18,7 +18,6 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
-import count from '@ckeditor/ckeditor5-utils/src/count';
 
 testUtils.createSinonSandbox();
 
@@ -41,19 +40,6 @@ describe( 'InlineEditor', () => {
 			editor = new InlineEditor( editorElement );
 		} );
 
-		it( 'creates a single div editable root in the view', () => {
-			editor.ui.init();
-
-			expect( editor.editing.view.getRoot() ).to.have.property( 'name', 'div' );
-
-			editor.ui.destroy();
-		} );
-
-		it( 'creates a single document root', () => {
-			expect( count( editor.model.document.getRootNames() ) ).to.equal( 1 );
-			expect( editor.model.document.getRoot() ).to.have.property( 'name', '$root' );
-		} );
-
 		it( 'creates the UI using BoxedEditorUI classes', () => {
 			expect( editor.ui ).to.be.instanceof( InlineEditorUI );
 			expect( editor.ui.view ).to.be.instanceof( InlineEditorUIView );

+ 0 - 5
packages/ckeditor5-editor-inline/tests/inlineeditorui.js

@@ -7,7 +7,6 @@
 
 import ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory';
 import View from '@ckeditor/ckeditor5-ui/src/view';
-import RootEditableElement from '@ckeditor/ckeditor5-engine/src/view/rooteditableelement';
 
 import InlineEditorUI from '../src/inlineeditorui';
 import InlineEditorUIView from '../src/inlineeditoruiview';
@@ -57,10 +56,6 @@ describe( 'InlineEditorUI', () => {
 		it( 'creates #focusTracker', () => {
 			expect( ui.focusTracker ).to.be.instanceOf( FocusTracker );
 		} );
-
-		it( 'creates root editable element', () => {
-			expect( editor.editing.view.getRoot() ).to.be.instanceOf( RootEditableElement );
-		} );
 	} );
 
 	describe( 'init()', () => {