diff options
author | timmywil <tim.willison@thisismedium.com> | 2011-05-25 19:59:29 -0400 |
---|---|---|
committer | timmywil <tim.willison@thisismedium.com> | 2011-05-25 19:59:29 -0400 |
commit | bdce86dc2edb43267ec5c4b7aab6d1932f294d6f (patch) | |
tree | 9f9925839685dfc9b8e2883078d8a9fca482e11b /src/dimensions.js | |
parent | edb2286544270dc53550180e06668e61c231fb5d (diff) | |
download | jquery-bdce86dc2edb43267ec5c4b7aab6d1932f294d6f.tar.gz jquery-bdce86dc2edb43267ec5c4b7aab6d1932f294d6f.zip |
Move window/document test to dimensions for consistency
Diffstat (limited to 'src/dimensions.js')
-rw-r--r-- | src/dimensions.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dimensions.js b/src/dimensions.js index 1ab92d1dd..8559056b5 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -7,17 +7,17 @@ jQuery.each([ "Height", "Width" ], function( i, name ) { // innerHeight and innerWidth jQuery.fn["inner" + name] = function() { - var ret; - return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, "padding" )) ) ? - ret : + var elem = this[0]; + return elem && elem.style ? + parseFloat( jQuery.css( elem, type, "padding" ) ) : null; }; // outerHeight and outerWidth jQuery.fn["outer" + name] = function( margin ) { - var ret; - return this[0] && !isNaN( ret = parseFloat(jQuery.css( this[0], type, margin ? "margin" : "border" )) ) ? - ret : + var elem = this[0]; + return elem && elem.style ? + parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) : null; }; |