git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Making some more adjustments to handle auto CSS properties.
[jquery.git]
/
src
/
css.js
diff --git
a/src/css.js
b/src/css.js
index
f263de8
..
eb7567f
100644
(file)
--- a/
src/css.js
+++ b/
src/css.js
@@
-66,19
+66,18
@@
jQuery.extend({
value += "px";
}
value += "px";
}
- if ( !("set" in hooks) || (value = hooks.set( elem, value )) === undefined ) {
+ if ( !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
style[ name ] = value;
}
} else {
style[ name ] = value;
}
} else {
- if ( "get" in hooks && (ret = hooks.get( elem, force, extra )) !== undefined ) {
+ if ( !force && "get" in hooks && (ret = hooks.get( elem, force, extra )) !== undefined ) {
return ret;
return ret;
- }
- if ( !force && style && style[ name ] ) {
+ } else if ( !force && style[ name ] ) {
ret = style[ name ];
ret = style[ name ];
- } else if ( curCSS ) {
+ } else if ( force !== false && curCSS ) {
ret = curCSS( elem, name, origName );
}
ret = curCSS( elem, name, origName );
}
@@
-119,12
+118,16
@@
jQuery.each(["height", "width"], function( i, name ) {
});
}
});
}
- return val;
+ return val + "px";
},
set: function( elem, value ) {
// ignore negative width and height values #1599
},
set: function( elem, value ) {
// ignore negative width and height values #1599
- return Math.max( parseFloat(value), 0 ) + "px";
+ value = parseFloat(value);
+
+ if ( value >= 0 ) {
+ return value + "px";
+ }
}
};
});
}
};
});
@@
-214,14
+217,14
@@
function getWH( elem, name, extra ) {
jQuery.each( which, function() {
if ( !extra ) {
jQuery.each( which, function() {
if ( !extra ) {
- val -= parseFloat(jQuery.css( elem, "padding" + this, undefined, true)) || 0;
+ val -= parseFloat(jQuery.css( elem, "padding" + this, undefined, true )) || 0;
}
if ( extra === "margin" ) {
}
if ( extra === "margin" ) {
- val += parseFloat(jQuery.css( elem, "margin" + this, undefined, true)) || 0;
+ val += parseFloat(jQuery.css( elem, "margin" + this, undefined, true )) || 0;
} else {
} else {
- val -= parseFloat(jQuery.css( elem, "border" + this + "Width", undefined, true)) || 0;
+ val -= parseFloat(jQuery.css( elem, "border" + this + "Width", undefined, true )) || 0;
}
});
}
});