Fixed issue with .add()ing individual elements - and with .add()ing form elements...
[jquery.git] / src / jquery / jquery.js
index ca4051f..38c8da3 100644 (file)
@@ -429,7 +429,7 @@ jQuery.fn = jQuery.prototype = {
                // Look for the case where we're accessing a style value
                if ( key.constructor == String )
                        if ( value == undefined )
-                               return jQuery[ type || "attr" ]( this[0], key );
+                               return this.length && jQuery[ type || "attr" ]( this[0], key ) || undefined;
                        else {
                                obj = {};
                                obj[ key ] = value;
@@ -985,7 +985,10 @@ jQuery.fn = jQuery.prototype = {
        add: function(t) {
                return this.pushStack( jQuery.merge(
                        this.get(),
-                       typeof t == "string" ? jQuery(t).get() : t )
+                       t.constructor == String ?
+                               jQuery(t).get() :
+                               t.length != undefined && !t.nodeName ?
+                                       t : [t] )
                );
        },
 
@@ -1268,7 +1271,7 @@ jQuery.extend({
                                return value.call( elem, [index] );
                                
                        // exclude the following css properties to add px
-                       var exclude = /z-?index|font-?weight|opacity/i;
+                       var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
 
                        // Handle passing in a number to a CSS property
                        if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )