Browse Source

Minor docs and tests improvements.

Aleksander Nowodzinski 6 years ago
parent
commit
673d3a6c23

+ 1 - 1
packages/ckeditor5-ui/src/button/button.jsdoc

@@ -96,7 +96,7 @@
  */
 
 /**
- * Controls whether the button view is recognized as toggle button for assistive technologies.
+ * Controls whether the button view is a toggle button (two–state) for assistive technologies.
  *
  * @observable
  * @default false

+ 2 - 9
packages/ckeditor5-ui/src/button/switchbuttonview.js

@@ -35,6 +35,8 @@ export default class SwitchButtonView extends ButtonView {
 	constructor( locale ) {
 		super( locale );
 
+		this.isToggleable = true;
+
 		/**
 		 * The toggle switch of the button.
 		 *
@@ -43,15 +45,6 @@ export default class SwitchButtonView extends ButtonView {
 		 */
 		this.toggleSwitchView = this._createToggleView();
 
-		/**
-		 * Controls whether the button view is recognized as toggle button for assistive technologies.
-		 *
-		 * @observable
-		 * @default true
-		 * @member {Boolean} #isToggleable
-		 */
-		this.isToggleable = true;
-
 		this.extendTemplate( {
 			attributes: {
 				class: 'ck-switchbutton'

+ 1 - 1
packages/ckeditor5-ui/tests/button/buttonview.js

@@ -253,7 +253,7 @@ describe( 'ButtonView', () => {
 				expect( view.element.attributes[ 'aria-pressed' ].value ).to.equal( 'false' );
 			} );
 
-			it( '-pressed is not present for not toggleable button', () => {
+			it( '-pressed is not present for non–toggleable button', () => {
 				view.isOn = true;
 				expect( view.element.hasAttribute( 'aria-pressed' ) ).to.be.false;