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

Commit 4e2ee36

Browse files
authored
Merge pull request #231 from ckeditor/t/230
Fix: `ContextualToolbar` should have proper editor toolbar styling. Closes #230.
2 parents fc67526 + 1e9ac7a commit 4e2ee36

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/toolbar/contextual/contextualtoolbar.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @module ui/toolbar/contextual/contextualtoolbar
88
*/
99

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

52+
Template.extend( this.toolbarView.template, {
53+
attributes: {
54+
class: 'ck-editor-toolbar'
55+
}
56+
} );
57+
5158
/**
5259
* The contextual balloon plugin instance.
5360
*
@@ -170,7 +177,7 @@ export default class ContextualToolbar extends Plugin {
170177
this._balloon.add( {
171178
view: this.toolbarView,
172179
position: this._getBalloonPositionData(),
173-
balloonClassName: 'ck-toolbar-container'
180+
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container'
174181
} )
175182
);
176183
} );

tests/toolbar/contextual/contextualtoolbar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe( 'ContextualToolbar', () => {
5858
expect( contextualToolbar ).to.instanceOf( Plugin );
5959
expect( contextualToolbar ).to.instanceOf( ContextualToolbar );
6060
expect( contextualToolbar.toolbarView ).to.instanceof( ToolbarView );
61+
expect( contextualToolbar.toolbarView.element.classList.contains( 'ck-editor-toolbar' ) ).to.be.true;
6162
} );
6263

6364
it( 'should load ContextualBalloon', () => {
@@ -157,7 +158,7 @@ describe( 'ContextualToolbar', () => {
157158
return contextualToolbar._showPanel().then( () => {
158159
sinon.assert.calledWithExactly( balloonAddSpy, {
159160
view: contextualToolbar.toolbarView,
160-
balloonClassName: 'ck-toolbar-container',
161+
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container',
161162
position: {
162163
target: forwardSelectionRect,
163164
positions: [ defaultPositions.southEastArrowNorth, defaultPositions.northEastArrowSouth ]
@@ -175,7 +176,7 @@ describe( 'ContextualToolbar', () => {
175176
.then( () => {
176177
sinon.assert.calledWithExactly( balloonAddSpy, {
177178
view: contextualToolbar.toolbarView,
178-
balloonClassName: 'ck-toolbar-container',
179+
balloonClassName: 'ck-toolbar-container ck-editor-toolbar-container',
179180
position: {
180181
target: backwardSelectionRect,
181182
positions: [ defaultPositions.northWestArrowSouth, defaultPositions.southWestArrowNorth ]

0 commit comments

Comments
 (0)