浏览代码

Merge branch t/ckeditor5-core/110

Internal: Update API usage after merge t/110 on engine.
Piotr Jasiun 8 年之前
父节点
当前提交
8f1f89f454

+ 0 - 1
packages/ckeditor5-editor-balloon/src/ballooneditor.js

@@ -56,7 +56,6 @@ export default class BalloonEditor extends StandardEditor {
 		this.config.get( 'plugins' ).push( ContextualToolbar );
 		this.config.define( 'contextualToolbar', this.config.get( 'toolbar' ) );
 
-		this.model.document.createRoot();
 		this.data.processor = new HtmlDataProcessor();
 		this.ui = new BalloonEditorUI( this, new BalloonEditorUIView( this.locale, element ) );
 	}

+ 1 - 4
packages/ckeditor5-editor-balloon/src/ballooneditorui.js

@@ -43,10 +43,6 @@ export default class BalloonEditorUI {
 		 * @inheritDoc
 		 */
 		this.focusTracker = new FocusTracker();
-
-		// RootEditableElement should be created together with the editor structure.
-		// See https://github.com/ckeditor/ckeditor5/issues/647.
-		editor.editing.createRoot( view.editableElement );
 	}
 
 	/**
@@ -66,6 +62,7 @@ export default class BalloonEditorUI {
 		// 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 - 10
packages/ckeditor5-editor-balloon/tests/ballooneditor.js

@@ -19,7 +19,6 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import ContextualToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/contextual/contextualtoolbar';
 
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
-import count from '@ckeditor/ckeditor5-utils/src/count';
 
 testUtils.createSinonSandbox();
 
@@ -53,11 +52,6 @@ describe( 'BalloonEditor', () => {
 			expect( editor.config.get( 'contextualToolbar' ) ).to.have.members( [ 'Bold' ] );
 		} );
 
-		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( 'uses HTMLDataProcessor', () => {
 			expect( editor.data.processor ).to.be.instanceof( HtmlDataProcessor );
 		} );
@@ -90,10 +84,6 @@ describe( 'BalloonEditor', () => {
 			expect( editor.editing.view.getDomRoot() ).to.equal( editor.ui.view.editable.element );
 		} );
 
-		it( 'creates a single div editable root in the view', () => {
-			expect( editor.editing.view.getRoot() ).to.have.property( 'name', 'div' );
-		} );
-
 		it( 'creates the UI using BalloonEditorUI classes', () => {
 			expect( editor.ui ).to.be.instanceof( BalloonEditorUI );
 			expect( editor.ui.view ).to.be.instanceof( BalloonEditorUIView );

+ 0 - 5
packages/ckeditor5-editor-balloon/tests/ballooneditorui.js

@@ -11,7 +11,6 @@ import BalloonEditorUIView from '../src/ballooneditoruiview';
 import VirtualTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/virtualtesteditor';
 import ContextualToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/contextual/contextualtoolbar';
 import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
-import RootEditableElement from '@ckeditor/ckeditor5-engine/src/view/rooteditableelement';
 import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
 import utils from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
@@ -50,10 +49,6 @@ describe( 'BalloonEditorUI', () => {
 		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()', () => {