🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@alexr101
Copy link
Contributor

Summary

Issue number #3423

Added radios to click.trigger function's conditional check. Originally it only filtered checkboxes, but now it filters all checkable types.

Checklist

Mark an [x] for completed items, if you're not sure leave them unchecked and we can assist.

Thanks! Bots and humans will be around shortly to check it out.

@jsf-clabot
Copy link

jsf-clabot commented Jan 11, 2017

CLA assistant check
All committers have signed the CLA.

@mention-bot
Copy link

@alexr101, thanks for your PR! By analyzing the history of the files in this pull request, we identified @timmywil, @gibson042 and @dmethvin to be potential reviewers.

@alexr101
Copy link
Contributor Author

I just signed the CLA after finding the link in the details link for the check. It's still showing not signed...is there anything else I need to do? Thanks!

Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, @alexr101! This looks good after a couple small changes.

src/event.js Outdated
"./var/rnothtmlwhite",
"./var/slice",
"./data/var/dataPriv",
"./manipulation/var/rcheckableType",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rcheckableType is no longer just for manipulation and should be promoted to a top-level var.

Copy link
Contributor Author

@alexr101 alexr101 Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gibson042 thanks, got it. Now I'm new to the project so sorry if the question might seem silly...
You're basically asking to change to
"./var/rcheckableType",

And that would also mean I'd need to change the location of rcheckabletype in the file structure too since it's currently inside the manipulation folder and not on the top level var? Which would also require a change of the "./manipulation/var/rcheckableType" line on the other files that require it as well, correct?

thanks again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know commits to my branch would automatically show up in the pull request. I thought they'd stay in my fork, and then I could send again to the pull request. I made some changes, but please ignore them. So I'll still need your input to confirm where I'm going with this. :)

Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some changes, but please ignore them. So I'll still need your input to confirm where I'm going with this.

This is definitely on the right track, and thanks for updating. One more round should do it (and don't forget to run the unit tests!).

src/event.js Outdated
"./core/init",
"./selector"
], function( jQuery, document, documentElement, rnothtmlwhite, slice, dataPriv ) {
], function( jQuery, document, documentElement, rnothtmlwhite, slice, dataPriv, rcheckableType ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter names need to line up with defined dependencies, so rcheckableType should precede slice.

if ( rcheckableType.test( this.type ) &&
this.click && jQuery.nodeName( this, "input" ) ) {
this.click();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blank is one line too low (it should follow the closing brace of the multi-line if condition, to separate it from its body).

@alexr101 alexr101 force-pushed the fix/click-event-fix-for-checkable-elements branch from ca7626a to c0067fb Compare January 17, 2017 21:37
@alexr101
Copy link
Contributor Author

Ok, this should be up good now.

I am sorry for the previous mess, I was worked on this from 3 different locations and each machine had certain issues. One I didn't have permissions on, so I couldn't install NPM, and all of them set default github usernames...which didn't let me pass the license/cla...but I fixed all of that by squashing the commits and changing the username and emails.

Anyways...let me know if it's allright now! Thanks!!!

Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, @alexr101. Thanks.

"./var/push",
"./var/rcheckableType",
"./core/access",
"./manipulation/var/rcheckableType",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to rearrange here, you also need to do so in the parameter list.

src/event.js Outdated
trigger: function() {
if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
if ( rcheckableType.test( this.type ) &&
this.click && jQuery.nodeName( this, "input" ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a blank line after the opening brace of the body here, to separate the multi-line condition from its block.

@alexr101
Copy link
Contributor Author

@gibson042 Got it, code should be up to standards now. Let me know if anything else needs changed.

Also just a general question. On the Issues board are contributions generally only accepted for problems with the "help wanted" tab? There don't seem to be many of these. I want to keep familiarizing myself with jQuery's source code, and I would love to keep contributing on issues that are at my current level.

@gibson042 gibson042 closed this in b442aba Jan 19, 2017
@gibson042
Copy link
Member

Thanks @alexr101; I noticed that a test was missing so added it. As for issues, feel free to work on anything unassigned, but please post first to give a heads-up. Your contributions are appreciated!

gibson042 pushed a commit to gibson042/jquery that referenced this pull request Jan 14, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants