This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
ListItemView should react to isEnabled
state changes.
#390
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oleq
suggested changes
May 15, 2018
src/list/listitemview.js
Outdated
@@ -49,7 +49,8 @@ export default class ListItemView extends View { | |||
'ck', | |||
'ck-list__item', | |||
bind.to( 'class' ), | |||
bind.if( 'isActive', 'ck-list__item_active' ) | |||
bind.if( 'isActive', 'ck-list__item_active' ), | |||
bind.to( 'isEnabled', value => value ? 'ck-enabled' : 'ck-disabled' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIR the .ck-enabled
class is a dummy class that does nothing. Could you check that and get rid of it across the project if you agree?
Searching 3161 files for "ck-enabled" (case sensitive)
/Users/oleq/CK/5/ckeditor5/docs/framework/guides/architecture/ui-library.md:
38 // The value of view#isEnabled will control the presence
39 // of the class.
40: bind.if( 'isEnabled', 'ck-enabled' ),
41 ],
42
..
111
112 ```html
113: <input class="foo ck-enabled" type="text" placeholder="Type some text" />
114 ```
115
/Users/oleq/CK/5/ckeditor5/packages/ckeditor5-ui/src/button/buttonview.js:
119 'ck',
120 'ck-button',
121: bind.to( 'isEnabled', value => value ? 'ck-enabled' : 'ck-disabled' ),
122 bind.if( 'isVisible', 'ck-hidden', value => !value ),
123 bind.to( 'isOn', value => value ? 'ck-on' : 'ck-off' ),
/Users/oleq/CK/5/ckeditor5/packages/ckeditor5-ui/tests/button/buttonview.js:
51 expect( view.element.classList.contains( 'ck' ) ).to.true;
52 expect( view.element.classList.contains( 'ck-button' ) ).to.true;
53: expect( view.element.classList.contains( 'ck-enabled' ) ).to.true;
54 expect( view.element.classList.contains( 'ck-off' ) ).to.true;
55 } );
4 matches across 3 files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it is a case. I'll remove it.
oleq
suggested changes
May 29, 2018
* @default true | ||
* @member {Boolean} #isEnabled | ||
*/ | ||
this.set( 'isEnabled', true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that, just like the ButtonView
, a disabled ListItemView
should not execute
if disabled.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested merge commit message (convention)
Other: The
ListItemView
now can be in disabled state by changingisEnabled
property. Closes ckeditor/ckeditor5#5453.Additional information