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 #61 from ckeditor/t/55
Browse files Browse the repository at this point in the history
Feature: Enabled the tooltip for the 'headings' component in editor.ui#componentFactory. Closes #55.
  • Loading branch information
szymonkups authored Mar 13, 2017
2 parents 39ba14b + 8a71dc5 commit 794e6df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default class Heading extends Plugin {
const dropdownItems = new Collection();
const options = this._getLocalizedOptions();
const commands = [];
const t = editor.t;
let defaultOption;

for ( let option of options ) {
Expand All @@ -63,7 +64,8 @@ export default class Heading extends Plugin {
// Create dropdown model.
const dropdownModel = new Model( {
withText: true,
items: dropdownItems
items: dropdownItems,
tooltip: t( 'Heading' )
} );

dropdownModel.bind( 'isEnabled' ).to(
Expand Down
1 change: 1 addition & 0 deletions tests/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe( 'Heading', () => {
expect( dropdown.buttonView.isEnabled ).to.be.true;
expect( dropdown.buttonView.isOn ).to.be.undefined;
expect( dropdown.buttonView.label ).to.equal( 'Paragraph' );
expect( dropdown.buttonView.tooltip ).to.equal( 'Heading' );
} );

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

0 comments on commit 794e6df

Please sign in to comment.