aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-05-26 16:51:41 -0400
committertimmywil <tim.willison@thisismedium.com>2011-05-26 16:51:41 -0400
commit1d202c6afc03c98dc656bf6bbde317fb0d050574 (patch)
tree3d2f5aafe3fc5f043971ddc3fd11405f0660d915 /src/attributes.js
parent9d4033d629fbfd1352e4ee5f20d0d320a61b80f1 (diff)
downloadjquery-1d202c6afc03c98dc656bf6bbde317fb0d050574.tar.gz
jquery-1d202c6afc03c98dc656bf6bbde317fb0d050574.zip
Move the value attrHook to the main attrHooks object to save bytes
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js39
1 files changed, 19 insertions, 20 deletions
diff --git a/src/attributes.js b/src/attributes.js
index 5396a90e5..abe52b896 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -414,6 +414,25 @@ jQuery.extend({
0 :
undefined;
}
+ },
+ // Use the value property for back compat
+ // Use the formHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
}
},
@@ -497,26 +516,6 @@ boolHook = {
}
};
-// Use the value property for back compat
-// Use the formHook for button elements in IE6/7 (#1954)
-jQuery.attrHooks.value = {
- get: function( elem, name ) {
- if ( formHook && jQuery.nodeName( elem, "button" ) ) {
- return formHook.get( elem, name );
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value, name ) {
- if ( formHook && jQuery.nodeName( elem, "button" ) ) {
- return formHook.set( elem, value, name );
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
-};
-
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !jQuery.support.getSetAttribute ) {