git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed some extra code that ifFunction deprecated.
[jquery.git]
/
src
/
jquery
/
jquery.js
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
ca4051f
..
38253c1
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-32,8
+32,7
@@
var jQuery = function(a,c) {
// HANDLE: $(function)
// Shortcut for document ready
// HANDLE: $(function)
// Shortcut for document ready
- // Safari reports typeof on DOM NodeLists as a function
- if ( jQuery.isFunction(a) && !a.nodeType && a[0] == undefined )
+ if ( jQuery.isFunction(a) )
return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a );
// Handle HTML strings
return new jQuery(document)[ jQuery.fn.ready ? "ready" : "load" ]( a );
// Handle HTML strings
@@
-429,7
+428,7
@@
jQuery.fn = jQuery.prototype = {
// Look for the case where we're accessing a style value
if ( key.constructor == String )
if ( value == undefined )
// 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;
else {
obj = {};
obj[ key ] = value;
@@
-985,7
+984,10
@@
jQuery.fn = jQuery.prototype = {
add: function(t) {
return this.pushStack( jQuery.merge(
this.get(),
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] )
);
},
);
},
@@
-1219,8
+1221,11
@@
jQuery.extend({
$ = jQuery._$;
},
$ = jQuery._$;
},
+ // This may seem like some crazy code, but trust me when I say that this
+ // is the only cross-browser way to do this. --John
isFunction: function( fn ) {
isFunction: function( fn ) {
- return fn && typeof fn == "function";
+ return !!fn && typeof fn != "string" &&
+ typeof fn[0] == "undefined" && /function/i.test( fn + "" );
},
/**
},
/**
@@
-1268,7
+1273,7
@@
jQuery.extend({
return value.call( elem, [index] );
// exclude the following css properties to add px
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) )
// Handle passing in a number to a CSS property
if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )