소스 검색

Set button as toggleable and add unit test checking it.

Mateusz Samsel 6 년 전
부모
커밋
46e1000bf6
2개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      packages/ckeditor5-paragraph/src/paragraphbuttonui.js
  2. 1 0
      packages/ckeditor5-paragraph/tests/paragraphbuttonui.js

+ 1 - 0
packages/ckeditor5-paragraph/src/paragraphbuttonui.js

@@ -40,6 +40,7 @@ export default class ParagraphButtonUI extends Plugin {
 			view.label = t( 'Paragraph' );
 			view.icon = icon;
 			view.tooltip = true;
+			view.isToggleable = true;
 			view.bind( 'isEnabled' ).to( command );
 			view.bind( 'isOn' ).to( command, 'value' );
 

+ 1 - 0
packages/ckeditor5-paragraph/tests/paragraphbuttonui.js

@@ -50,6 +50,7 @@ describe( 'HeadingButtonUI', () => {
 			expect( paragraphButton.label ).to.equal( 'Paragraph' );
 			expect( paragraphButton.icon ).to.equal( icon );
 			expect( paragraphButton.tooltip ).to.equal( true );
+			expect( paragraphButton.isToggleable ).to.equal( true );
 		} );
 
 		it( 'should bind button to command', () => {