Skip to content

Use toggleClass instead of [ bool ? "addClass" : "removeClass" ] #77

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

Closed
wants to merge 1 commit into from

Conversation

xavi-
Copy link
Contributor

@xavi- xavi- commented Dec 19, 2010

Several times in the jquery-ui code base a class is conditionally added to an element using this construct: elem[ bool ? "addClass" : "removeClass" ]("foo"). I propose that $.fn.toggleClass be used instead. I feel this change will make the code less verbose and easier to read.

Ticket #6764

@scottgonzalez
Copy link
Member

Thanks, landed in 956697b.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants