Skip to content

Commit

Permalink
Make sure that the CSS hook getter isn't called if a forced computed …
Browse files Browse the repository at this point in the history
…style is done.
  • Loading branch information
jeresig committed Sep 9, 2010
1 parent 70377a6 commit c36596e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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;
}
});

Expand Down

0 comments on commit c36596e

Please sign in to comment.