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

Commit

Permalink
Merge pull request #231 from ckeditor/t/230
Browse files Browse the repository at this point in the history
Fix: `ContextualToolbar` should have proper editor toolbar styling. Closes #230.
  • Loading branch information
oskarwrobel authored May 11, 2017
2 parents fc67526 + 1e9ac7a commit 4e2ee36
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/toolbar/contextual/contextualtoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @module ui/toolbar/contextual/contextualtoolbar
*/

import Template from '../../template';
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ContextualBalloon from '../../panel/balloon/contextualballoon';
import ToolbarView from '../toolbarview';
Expand Down Expand Up @@ -48,6 +49,12 @@ export default class ContextualToolbar extends Plugin {
*/
this.toolbarView = new ToolbarView( this.editor.locale );

Template.extend( this.toolbarView.template, {
attributes: {
class: 'ck-editor-toolbar'
}
} );

/**
* The contextual balloon plugin instance.
*
Expand Down Expand Up @@ -170,7 +177,7 @@ export default class ContextualToolbar extends Plugin {
this._balloon.add( {
view: this.toolbarView,
position: this._getBalloonPositionData(),
balloonClassName: 'ck-toolbar-container'
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container'
} )
);
} );
Expand Down
5 changes: 3 additions & 2 deletions tests/toolbar/contextual/contextualtoolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ describe( 'ContextualToolbar', () => {
expect( contextualToolbar ).to.instanceOf( Plugin );
expect( contextualToolbar ).to.instanceOf( ContextualToolbar );
expect( contextualToolbar.toolbarView ).to.instanceof( ToolbarView );
expect( contextualToolbar.toolbarView.element.classList.contains( 'ck-editor-toolbar' ) ).to.be.true;
} );

it( 'should load ContextualBalloon', () => {
Expand Down Expand Up @@ -157,7 +158,7 @@ describe( 'ContextualToolbar', () => {
return contextualToolbar._showPanel().then( () => {
sinon.assert.calledWithExactly( balloonAddSpy, {
view: contextualToolbar.toolbarView,
balloonClassName: 'ck-toolbar-container',
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container',
position: {
target: forwardSelectionRect,
positions: [ defaultPositions.southEastArrowNorth, defaultPositions.northEastArrowSouth ]
Expand All @@ -175,7 +176,7 @@ describe( 'ContextualToolbar', () => {
.then( () => {
sinon.assert.calledWithExactly( balloonAddSpy, {
view: contextualToolbar.toolbarView,
balloonClassName: 'ck-toolbar-container',
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container',
position: {
target: backwardSelectionRect,
positions: [ defaultPositions.northWestArrowSouth, defaultPositions.southWestArrowNorth ]
Expand Down

0 comments on commit 4e2ee36

Please sign in to comment.