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

Commit 794e6df

Browse files
authored
Merge pull request #61 from ckeditor/t/55
Feature: Enabled the tooltip for the 'headings' component in editor.ui#componentFactory. Closes #55.
2 parents 39ba14b + 8a71dc5 commit 794e6df

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/heading.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default class Heading extends Plugin {
3838
const dropdownItems = new Collection();
3939
const options = this._getLocalizedOptions();
4040
const commands = [];
41+
const t = editor.t;
4142
let defaultOption;
4243

4344
for ( let option of options ) {
@@ -63,7 +64,8 @@ export default class Heading extends Plugin {
6364
// Create dropdown model.
6465
const dropdownModel = new Model( {
6566
withText: true,
66-
items: dropdownItems
67+
items: dropdownItems,
68+
tooltip: t( 'Heading' )
6769
} );
6870

6971
dropdownModel.bind( 'isEnabled' ).to(

tests/heading.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ describe( 'Heading', () => {
5757
expect( dropdown.buttonView.isEnabled ).to.be.true;
5858
expect( dropdown.buttonView.isOn ).to.be.undefined;
5959
expect( dropdown.buttonView.label ).to.equal( 'Paragraph' );
60+
expect( dropdown.buttonView.tooltip ).to.equal( 'Heading' );
6061
} );
6162

6263
it( 'should execute format command on model execute event', () => {

0 commit comments

Comments
 (0)