Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#1415788: Javascript winter clean-up
Replace $element[check ? 'addClass' : 'removeClass']('classname');
with $element.toggleClass('classname', check);
, same for show/hide.
Comment | File | Size | Author |
---|---|---|---|
#4 | core_js_jquery_toggle-1428538-d7-4.patch | 1.4 KB | Albert Volkman |
core-js-jquery-toggle.patch | 1.45 KB | nod_ | |
Comments
Comment #1
droplet CreditAttribution: droplet commentedcleaner code
Comment #2
droplet CreditAttribution: droplet commentedComment #3
Dries CreditAttribution: Dries commentedCommitted to 8.x. Patch will need a re-roll for 7.x so moving to 7.x with the 'to be ported' status.
Comment #4
Albert Volkman CreditAttribution: Albert Volkman commentedD7 re-roll!
Comment #5
nod_Works for me, thanks :)
Comment #6
webchickCommitted and pushed to 7.x. Thanks for all of these nice JS clean-up patches!