Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge branch t/ckeditor5-core/110
Browse files Browse the repository at this point in the history
Internal: Update API usage after merge t/110 on engine.
  • Loading branch information
Piotr Jasiun committed Jan 11, 2018
2 parents 3ed55ad + 0d2dee8 commit 0625d55
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion src/ballooneditor.js
Expand Up @@ -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 ) );
}
Expand Down
5 changes: 1 addition & 4 deletions src/ballooneditorui.js
Expand Up @@ -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 );
}

/**
Expand All @@ -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 );
Expand Down
10 changes: 0 additions & 10 deletions tests/ballooneditor.js
Expand Up @@ -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();

Expand Down Expand Up @@ -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 );
} );
Expand Down Expand Up @@ -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 );
Expand Down
5 changes: 0 additions & 5 deletions tests/ballooneditorui.js
Expand Up @@ -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';

Expand Down Expand Up @@ -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()', () => {
Expand Down

0 comments on commit 0625d55

Please sign in to comment.