]> source.dussan.org Git - jquery.git/commitdiff
Move the value attrHook to the main attrHooks object to save bytes
authortimmywil <tim.willison@thisismedium.com>
Thu, 26 May 2011 20:51:41 +0000 (16:51 -0400)
committertimmywil <tim.willison@thisismedium.com>
Thu, 26 May 2011 20:51:41 +0000 (16:51 -0400)
src/attributes.js

index 5396a90e5af31a104186f16cc1707f6c87d94351..abe52b896bc52a00f456f43934c6da7a801f795b 100644 (file)
@@ -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 ) {