aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-09-09 16:26:30 -0400
committerjeresig <jeresig@gmail.com>2010-09-09 16:26:30 -0400
commitc36596ea58a69f7772b61829f8d0609a6fb1d9a0 (patch)
treede07e280f072552a02416f181e756032a9052b0d
parent70377a65e2a1c8478f3dc1e0e125b7b25b5324f3 (diff)
downloadjquery-c36596ea58a69f7772b61829f8d0609a6fb1d9a0.tar.gz
jquery-c36596ea58a69f7772b61829f8d0609a6fb1d9a0.zip
Make sure that the CSS hook getter isn't called if a forced computed style is done.
-rw-r--r--src/css.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/css.js b/src/css.js
index f92125819..7a96020db 100644
--- a/src/css.js
+++ b/src/css.js
@@ -71,11 +71,10 @@ jQuery.extend({
}
} 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;
- }
- if ( !force && style && style[ name ] ) {
+ } else if ( !force && style[ name ] ) {
ret = style[ name ];
} else if ( curCSS ) {
@@ -214,14 +213,14 @@ function getWH( elem, name, 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" ) {
- val += parseFloat(jQuery.css( elem, "margin" + this, undefined, true)) || 0;
+ val += parseFloat(jQuery.css( elem, "margin" + this, undefined, true )) || 0;
} else {
- val -= parseFloat(jQuery.css( elem, "border" + this + "Width", undefined, true)) || 0;
+ val -= parseFloat(jQuery.css( elem, "border" + this + "Width", undefined, true )) || 0;
}
});