Permalink
Show file tree
Hide file tree
2 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Restrict the attr quick setters to only methods that specifically ask…
… for the functionality. Fixes #5612.
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
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
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
f25eedf
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.
What's the reason for adding the event bindings to .attr()? There can't possibly be existing code like $(el).attr('click', fn) that's expected to bind a listener. I could maybe see supporting .attr('onclick', fn) but the current implementation seems odd to me.
f25eedf
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's mostly for simplifying the process of setting properties in bulk - for example:
It effectively takes a bunch of the common setter cases, not handled by attr, and integrates them into a single method.