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 #95 from ckeditor/t/ckeditor5/1403
Browse files Browse the repository at this point in the history
Fix: The UI buttons should be marked as toggleable for better assistive technologies support (see ckeditor/ckeditor5#1403).
  • Loading branch information
oleq committed Aug 12, 2019
2 parents b8b6cbc + bd36451 commit b9f5867
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/bold/boldui.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class BoldUI extends Plugin {
label: t( 'Bold' ),
icon: boldIcon,
keystroke: 'CTRL+B',
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/code/codeui.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export default class CodeUI extends Plugin {
view.set( {
label: t( 'Code' ),
icon: codeIcon,
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/italic/italicui.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class ItalicUI extends Plugin {
label: t( 'Italic' ),
icon: italicIcon,
keystroke: 'CTRL+I',
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/strikethrough/strikethroughui.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class StrikethroughUI extends Plugin {
label: t( 'Strikethrough' ),
icon: strikethroughIcon,
keystroke: 'CTRL+SHIFT+X',
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/subscript/subscriptui.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default class SubscriptUI extends Plugin {
view.set( {
label: t( 'Subscript' ),
icon: subscriptIcon,
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/superscript/superscriptui.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default class SuperscriptUI extends Plugin {
view.set( {
label: t( 'Superscript' ),
icon: superscriptIcon,
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
3 changes: 2 additions & 1 deletion src/underline/underlineui.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default class UnderlineUI extends Plugin {
label: t( 'Underline' ),
icon: underlineIcon,
keystroke: 'CTRL+U',
tooltip: true
tooltip: true,
isToggleable: true
} );

view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
Expand Down
1 change: 1 addition & 0 deletions tests/bold/boldui.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ describe( 'BoldUI', () => {
expect( boldView.label ).to.equal( 'Bold' );
expect( boldView.icon ).to.match( /<svg / );
expect( boldView.keystroke ).to.equal( 'CTRL+B' );
expect( boldView.isToggleable ).to.be.true;
} );

it( 'should execute bold command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/code/codeui.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe( 'CodeUI', () => {
expect( codeView.isOn ).to.be.false;
expect( codeView.label ).to.equal( 'Code' );
expect( codeView.icon ).to.match( /<svg / );
expect( codeView.isToggleable ).to.be.true;
} );

it( 'should execute code command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/italic/italicui.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe( 'ItalicUI', () => {
expect( italicView.label ).to.equal( 'Italic' );
expect( italicView.icon ).to.match( /<svg / );
expect( italicView.keystroke ).to.equal( 'CTRL+I' );
expect( italicView.isToggleable ).to.be.true;
} );

it( 'should execute italic command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/strikethrough/strikethroughui.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe( 'StrikethroughUI', () => {
expect( strikeView.label ).to.equal( 'Strikethrough' );
expect( strikeView.icon ).to.match( /<svg / );
expect( strikeView.keystroke ).to.equal( 'CTRL+SHIFT+X' );
expect( strikeView.isToggleable ).to.be.true;
} );

it( 'should execute strikethrough command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/subscript/subscriptui.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe( 'SubscriptUI', () => {
expect( subView.isOn ).to.be.false;
expect( subView.label ).to.equal( 'Subscript' );
expect( subView.icon ).to.match( /<svg / );
expect( subView.isToggleable ).to.be.true;
} );

it( 'should execute subscript command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/superscript/superscriptui.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe( 'SuperscriptUI', () => {
expect( superView.isOn ).to.be.false;
expect( superView.label ).to.equal( 'Superscript' );
expect( superView.icon ).to.match( /<svg / );
expect( superView.isToggleable ).to.be.true;
} );

it( 'should execute superscript command on model execute event', () => {
Expand Down
1 change: 1 addition & 0 deletions tests/underline/underlineui.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe( 'Underline', () => {
expect( underlineView.label ).to.equal( 'Underline' );
expect( underlineView.icon ).to.match( /<svg / );
expect( underlineView.keystroke ).to.equal( 'CTRL+U' );
expect( underlineView.isToggleable ).to.be.true;
} );

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

0 comments on commit b9f5867

Please sign in to comment.