Browse Source

Added: Alignment dropdown should have CSS class added.

Maciej Gołaszewski 7 years ago
parent
commit
c4884dc80b

+ 6 - 0
packages/ckeditor5-alignment/src/alignmentui.js

@@ -97,6 +97,12 @@ export default class AlignmentUI extends Plugin {
 				tooltip: true
 			} );
 
+			dropdownView.extendTemplate( {
+				attributes: {
+					class: 'ck-alignment-dropdown'
+				}
+			} );
+
 			// The default icon is align left as we do not support RTL yet (see #3).
 			const defaultIcon = alignLeftIcon;
 

+ 6 - 0
packages/ckeditor5-alignment/tests/alignmentui.js

@@ -217,6 +217,12 @@ describe( 'Alignment UI', () => {
 			expect( button ).to.have.property( 'tooltip', true );
 		} );
 
+		it( 'should add custom CSS class to dropdown', () => {
+			dropdown.render();
+
+			expect( dropdown.element.classList.contains( 'ck-alignment-dropdown' ) ).to.be.true;
+		} );
+
 		it( '#toolbarView has the base properties', () => {
 			const toolbarView = dropdown.toolbarView;