-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make choices_click() method more readable. #1163
Conversation
@stof Your input is appreciated, as well. |
After testing this, I don't think the |
Ok. Closing this. |
Looks like we do need this, for now. |
I guess we need this to open the search results when a field is active. Fair enough. Much easier to read and seems to work the same as current Chosen. I think the initial point was to not open search results on choice click, but that's not what the actual result of the method was. So I say carry on. |
Conflicts: chosen/chosen.jquery.min.js chosen/chosen.proto.min.js
Make choices_click() method more readable.
choices_click: (evt) -> | ||
evt.preventDefault() | ||
if( @active_field and not($(evt.target).hasClass "search-choice" or $(evt.target).parents('.search-choice').first) and not @results_showing ) | ||
this.results_show() | ||
this.results_show() unless @results_showing |
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.
as it is now the same in both versions, it could be moved to AbstractChosen
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.
Cool. I'll do that.
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.
This was a small enough change. I committed straight to master: 9969a46
@pfiller
This is in response to issue #193. I believe I have the logic rewritten to be cleaner. However, I'm not sure that the behavior is quite right. Clicking any of the already chosen items in the input field will open the list except when the field has focus. Is that correct behavior?