diff --git a/src/linkui.js b/src/linkui.js index 3be24b2..4e62f1a 100644 --- a/src/linkui.js +++ b/src/linkui.js @@ -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() ); diff --git a/tests/linkui.js b/tests/linkui.js index 11d4f15..3cbc1b0 100644 --- a/tests/linkui.js +++ b/tests/linkui.js @@ -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; } );