git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed regression with 5276 where return false in first handler of multiple handlers...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
aa233f8
..
6308a99
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-595,7
+595,7
@@
jQuery.extend = jQuery.fn.extend = function() {
// Recurse if we're merging object values
if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType )
// Recurse if we're merging object values
if ( deep && options[ name ] && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType )
- target[ name ] = jQuery.extend( target[ name ], options[ name ] );
+ target[ name ] = jQuery.extend( deep, target[ name ], options[ name ] );
// Don't bring in undefined values
else if ( options[ name ] != undefined )
// Don't bring in undefined values
else if ( options[ name ] != undefined )
@@
-611,6
+611,8
@@
var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {};
// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
// exclude the following css properties to add px
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
+// cache getComputedStyle
+var getComputedStyle = document.defaultView && document.defaultView.getComputedStyle;
jQuery.extend({
noConflict: function( deep ) {
jQuery.extend({
noConflict: function( deep ) {
@@
-837,8
+839,9
@@
jQuery.extend({
function color( elem ) {
if ( !jQuery.browser.safari )
return false;
function color( elem ) {
if ( !jQuery.browser.safari )
return false;
-
- var ret = document.defaultView.getComputedStyle( elem, null );
+
+ // getComputedStyle is cached
+ var ret = getComputedStyle( elem, null );
return !ret || ret.getPropertyValue("color") == "";
}
return !ret || ret.getPropertyValue("color") == "";
}
@@
-864,7
+867,7
@@
jQuery.extend({
if ( !force && elem.style && elem.style[ name ] )
ret = elem.style[ name ];
if ( !force && elem.style && elem.style[ name ] )
ret = elem.style[ name ];
- else if ( document.defaultView && document.defaultView.getComputedStyle ) {
+ else if ( getComputedStyle ) {
// Only "float" is needed here
if ( name.match( /float/i ) )
// Only "float" is needed here
if ( name.match( /float/i ) )
@@
-872,10
+875,10
@@
jQuery.extend({
name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
- var getComputedStyle = document.defaultView.getComputedStyle( elem, null );
+ var computedStyle = getComputedStyle( elem, null );
- if ( getComputedStyle && !color( elem ) )
- ret = getComputedStyle.getPropertyValue( name );
+ if ( computedStyle && !color( elem ) )
+ ret = computedStyle.getPropertyValue( name );
// If the element isn't reporting its values properly in Safari
// then some display: none elements are involved
// If the element isn't reporting its values properly in Safari
// then some display: none elements are involved
@@
-898,7
+901,7
@@
jQuery.extend({
// one special, otherwise get the value
ret = name == "display" && swap[ stack.length - 1 ] != null ?
"none" :
// one special, otherwise get the value
ret = name == "display" && swap[ stack.length - 1 ] != null ?
"none" :
- ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || "";
+ ( computedStyle && computedStyle.getPropertyValue( name ) ) || "";
// Finally, revert the display styles back
for ( var i = 0; i < swap.length; i++ )
// Finally, revert the display styles back
for ( var i = 0; i < swap.length; i++ )
@@
-1121,7
+1124,7
@@
jQuery.extend({
var ret = [];
// Need to use typeof to fight Safari childNodes crashes
var ret = [];
// Need to use typeof to fight Safari childNodes crashes
- if ( typeof array != "array" )
+ if ( array.constructor != Array )
for ( var i = 0, length = array.length; i < length; i++ )
ret.push( array[ i ] );
else
for ( var i = 0, length = array.length; i < length; i++ )
ret.push( array[ i ] );
else