-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error. Where if you do shift select and click another element (so… #38
Conversation
… all others are unselected) the class is-selected does not get removed from others
Changes Unknown when pulling fa66878 on EWhite613:master into * on ciena-frost:master*. |
Changes Unknown when pulling fa66878 on EWhite613:master into * on ciena-frost:master*. |
@@ -10,7 +11,10 @@ export default Ember.Component.extend({ | |||
}), | |||
|
|||
isSelected: Ember.computed.reads('model.isSelected'), | |||
|
|||
isSelectedChanged: Ember.observer('model.isSelected', function () { |
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.
Urgh, trying to avoid observers - do we have another approach to this?
Changes Unknown when pulling 9c4835c on EWhite613:master into * on ciena-frost:master*. |
isSelected: Ember.computed('model.isSelected', function () { | ||
let modelIsSelect = this.get('model.isSelected') | ||
modelIsSelect ? $(this.get('element')).parent().addClass('is-selected') | ||
: $(this.get('element')).parent().removeClass('is-selected') |
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.
Computed with side effects is better, but also not ideal - do we absolutely need access to the parent in this case and is the parent not an ember component?
Might be worth a pairing session to take a look at solutions
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 need to be able to bind the class to the parent. The parent is an ember component. I can extend it and do the binding similar to this
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.
Funky - give it a shot 👍
Changes Unknown when pulling 30fd0ca on EWhite613:master into * on ciena-frost:master*. |
Changes Unknown when pulling 30fd0ca on EWhite613:master into * on ciena-frost:master*. |
Changes Unknown when pulling fcc4444 on EWhite613:master into * on ciena-frost:master*. |
… all others are unselected) the class is-selected does not get removed from others
patch