We currently use $.browser to check for IE6/7 oddities, but $.browser no longer exists in newer versions of jQuery. With IE6/7 usage below 1%, we should remove these checks.
In addition, we're using $.fn.attr frequently to get/set checkbox values, but this no longer works correctly in jQuery 1.6 and higher. We should use $.fn.prop when appropriate instead: http://api.jquery.com/prop
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | options_element_prop-2242787.patch | 5.53 KB | quicksketch |
| #4 | options_element_prop-2242787.patch | 5.53 KB | quicksketch |
| #1 | options_element_browser_check-2242787.patch | 1.38 KB | quicksketch |
Comments
Comment #1
quicksketchCommitted this to both branches.
Comment #3
quicksketchHmm, actually this problem is more widespread than I had thought. Besides the use of $.browser, we need to correctly use $.fn.prop (http://api.jquery.com/prop) for checking "disabled" and "checked" states. Unfortunately, $.fn.attr acts inconsistently between versions of jQuery, so we'll need some kind of check to use prop when possible and attr if not.
Comment #4
quicksketchThis patch conditionally switches between $.fn.prop if available and $.fn.attr otherwise. We did something similar in #1690202: Options textfields disabled on webform component (with jQuery Update), but it wasn't comprehensively used throughout the module. Note that only boolean properties like disabled and checked require this switch. The use of $.fn.attr on things like colspan and id are still valid.
I'm open to a prettier way of doing this, but since we use prop/attr so frequently, making a new jQuery method seemed like the most reasonable option to me.
Comment #5
quicksketchComment #6
quicksketchOkay, committed this patch to both branches. I'll make a new release shortly.