aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-03-11 14:57:37 -0500
committertimmywil <tim.willison@thisismedium.com>2011-04-03 19:13:38 -0400
commit00abeaee17a0eed8422a15ff5d48f4011490953b (patch)
tree04ae4fd08b4a805f30a9c21a4266368937bf0442 /src/attributes.js
parent4baa213d881a71ffd8557bc587f81d0bc606d63c (diff)
downloadjquery-00abeaee17a0eed8422a15ff5d48f4011490953b.tar.gz
jquery-00abeaee17a0eed8422a15ff5d48f4011490953b.zip
Didn't actually need the hooks anymore
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/attributes.js b/src/attributes.js
index ee4dc1bad..d6179a126 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -275,6 +275,8 @@ jQuery.extend({
offset: true
},
+ attrFix: {},
+
attr: function( elem, name, value, pass ) {
// don't get/set attributes on text, comment and attribute nodes
@@ -285,11 +287,14 @@ jQuery.extend({
if ( pass && name in jQuery.attrFn ) {
return jQuery(elem)[name](value);
}
-
+
var ret,
notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
hooks;
+ // Normalize the name if needed
+ name = notxml && jQuery.attrFix[ name ] || name;
+
hooks = jQuery.attrHooks[ name ];
if ( value !== undefined ) {
@@ -472,8 +477,8 @@ if ( !jQuery.support.optSelected ) {
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( jQuery.support.attrFix ) {
- var attrFix = {
- "for": "htmlFor",
+ jQuery.extend(jQuery.attrFix, {
+ "for": "htmlFor",
"class": "className",
readonly: "readOnly",
maxlength: "maxLength",
@@ -483,17 +488,5 @@ if ( jQuery.support.attrFix ) {
tabindex: "tabIndex",
usemap: "useMap",
frameborder: "frameBorder"
- };
-
- jQuery.each(attrFix, function( key, name ) {
- jQuery.attrHooks[ key ] = jQuery.extend( jQuery.attrHooks[ key ], {
- get: function( elem ) {
- return elem.getAttribute( name );
- },
- set: function( elem, value ) {
- elem.setAttribute( name, value );
- return value;
- }
- });
- });
+ });
} \ No newline at end of file