Selaa lähdekoodia

Added additional class to the ContextualBalloon#view element when Contextualtoolbar is opened.

Oskar Wróbel 8 vuotta sitten
vanhempi
commit
6dbf88bf70

+ 2 - 1
packages/ckeditor5-ui/src/toolbar/contextual/contextualtoolbar.js

@@ -149,7 +149,8 @@ export default class ContextualToolbar extends Plugin {
 		// Add panel to the common editor contextual balloon.
 		this._balloon.add( {
 			view: this.toolbarView,
-			position: this._getBalloonPositionData()
+			position: this._getBalloonPositionData(),
+			balloonClassName: 'ck-toolbar__container'
 		} );
 
 		// Update panel position when selection changes while balloon will be opened (by a collaboration).

+ 8 - 0
packages/ckeditor5-ui/tests/toolbar/contextual/contextualtoolbar.js

@@ -113,6 +113,14 @@ describe( 'ContextualToolbar', () => {
 		expect( balloon.visibleView ).to.equal( contextualToolbar.toolbarView );
 	} );
 
+	it( 'should add additional class to the ContextualBalloon#view', () => {
+		setData( editor.document, '<paragraph>[bar]</paragraph>' );
+
+		contextualToolbar.fire( '_selectionChangeDebounced' );
+
+		expect( balloon.view.className ).to.equal( 'ck-toolbar__container' );
+	} );
+
 	it( 'should close when selection starts changing by a directChange', () => {
 		setData( editor.document, '<paragraph>[bar]</paragraph>' );