-
-
Notifications
You must be signed in to change notification settings - Fork 87
emberjs.com styles #96
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
Changes from all commits
89e0e6a
350ea12
3c1a655
01d2a1a
b966409
27dcba6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import Ember from 'ember'; | ||
|
|
||
| export default Ember.Component.extend({ | ||
| classNames: ['input-edit'], | ||
| classNameBindings: ['active'], | ||
|
|
||
| //proxy clicks to input focus | ||
| click() { | ||
| this.$('input').focus(); | ||
| }, | ||
|
|
||
| actions: { | ||
| inputFocusIn() { | ||
| this.set('active', true); | ||
| }, | ||
|
|
||
| inputFocusOut() { | ||
| this.set('active', false); | ||
| } | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of setting your own class with these actions, you could have used the :focus pseudo-class in CSS.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to. The focus "proxying" part I'm pretty sure that can't be done with css. Remember we now have a container that holds both the input and the pencil icon.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe possible with some
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the old issue; CSS does not have a :parent selector |
||
|
|
||
| }); | ||
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.
one last question: cant't the behaviour this provides also be done with CSS
:focus?