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 #201 from ckeditor/t/173
Browse files Browse the repository at this point in the history
Other: The link button will be active when the selection is placed inside a link. Closes #173.
  • Loading branch information
Reinmar authored Sep 7, 2018
2 parents a42ba3c + 44e0eac commit c9e4bc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/linkui.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class LinkUI extends Plugin {
button.tooltip = true;

// Bind button to the command.
button.bind( 'isEnabled' ).to( linkCommand, 'isEnabled' );
button.bind( 'isOn', 'isEnabled' ).to( linkCommand, 'value', 'isEnabled' );

// Show the panel on button click.
this.listenTo( button, 'execute', () => this._showUI() );
Expand Down
6 changes: 6 additions & 0 deletions tests/linkui.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ describe( 'LinkUI', () => {
const command = editor.commands.get( 'link' );

command.isEnabled = true;
command.value = true;

expect( linkButton.isOn ).to.be.true;
expect( linkButton.isEnabled ).to.be.true;

command.isEnabled = false;
command.value = false;

expect( linkButton.isOn ).to.be.false;
expect( linkButton.isEnabled ).to.be.false;
} );

Expand Down

0 comments on commit c9e4bc3

Please sign in to comment.