git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for #193 again
[jquery.git]
/
src
/
jquery
/
jquery.js
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
7a59a4e
..
2ddb919
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-28,7
+28,7
@@
window.undefined = window.undefined;
* @name jQuery
* @cat Core
*/
* @name jQuery
* @cat Core
*/
-jQuery = function(a,c) {
+var jQuery = function(a,c) {
// Shortcut for document ready (because $(document).each() is silly)
if ( a && typeof a == "function" && jQuery.fn.ready )
// Shortcut for document ready (because $(document).each() is silly)
if ( a && typeof a == "function" && jQuery.fn.ready )
@@
-63,12
+63,14
@@
jQuery = function(a,c) {
// Find the matching elements and save them for later
jQuery.find( a, c ) );
// Find the matching elements and save them for later
jQuery.find( a, c ) );
- // See if an extra function was provided
+ // See if an extra function was provided
var fn = arguments[ arguments.length - 1 ];
// If so, execute it in context
if ( fn && typeof fn == "function" )
this.each(fn);
var fn = arguments[ arguments.length - 1 ];
// If so, execute it in context
if ( fn && typeof fn == "function" )
this.each(fn);
+
+ return this;
};
// Map over the $ in case of overwrite
};
// Map over the $ in case of overwrite
@@
-1031,6
+1033,7
@@
jQuery.fn = jQuery.prototype = {
for ( var i = 0; i < t.length; i++ )
if ( jQuery.filter(t[i],[a]).r.length )
return a;
for ( var i = 0; i < t.length; i++ )
if ( jQuery.filter(t[i],[a]).r.length )
return a;
+ return false;
}) ||
t.constructor == Boolean &&
}) ||
t.constructor == Boolean &&
@@
-1294,8
+1297,17
@@
jQuery.fn = jQuery.prototype = {
* @cat Javascript
*/
jQuery.extend = jQuery.fn.extend = function(obj,prop) {
* @cat Javascript
*/
jQuery.extend = jQuery.fn.extend = function(obj,prop) {
+ // Watch for the case where null or undefined gets passed in by accident
+ if ( arguments.length > 1 && (prop === null || prop == undefined) )
+ return obj;
+
+ // If no property object was provided, then we're extending jQuery
if ( !prop ) { prop = obj; obj = this; }
if ( !prop ) { prop = obj; obj = this; }
+
+ // Extend the base object
for ( var i in prop ) obj[i] = prop[i];
for ( var i in prop ) obj[i] = prop[i];
+
+ // Return the modified object
return obj;
};
return obj;
};
@@
-1489,6
+1501,9
@@
jQuery.extend({
} else if (document.defaultView && document.defaultView.getComputedStyle) {
} else if (document.defaultView && document.defaultView.getComputedStyle) {
+ if (prop == "cssFloat" || prop == "styleFloat")
+ prop = "float";
+
prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
var cur = document.defaultView.getComputedStyle(elem, null);
prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase();
var cur = document.defaultView.getComputedStyle(elem, null);
@@
-2233,12
+2248,12
@@
jQuery.extend({
},
handle: function(event) {
},
handle: function(event) {
- if ( typeof jQuery == "undefined" ) return;
+ if ( typeof jQuery == "undefined" ) return false;
event = event || jQuery.event.fix( window.event );
// If no correct event was found, fail
event = event || jQuery.event.fix( window.event );
// If no correct event was found, fail
- if ( !event ) return;
+ if ( !event ) return false;
var returnValue = true;
var returnValue = true;