aboutsummaryrefslogtreecommitdiffstats
path: root/src/dimensions.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-07-09 21:38:11 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-07-09 21:39:22 -0400
commit8f01b92b8fd85a66f2cba671f8b9ff6f7095c34b (patch)
tree6120b02292d65f3ac1248a7c82aae5fbbb505d7d /src/dimensions.js
parentf30f7732e7775b6e417c4c22ced7adb2bf76bf89 (diff)
downloadjquery-8f01b92b8fd85a66f2cba671f8b9ff6f7095c34b.tar.gz
jquery-8f01b92b8fd85a66f2cba671f8b9ff6f7095c34b.zip
Follow the style guide, lose 72 bytes! Closes gh-840.
Diffstat (limited to 'src/dimensions.js')
-rw-r--r--src/dimensions.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/dimensions.js b/src/dimensions.js
index dc7b4ceb4..c8034bc61 100644
--- a/src/dimensions.js
+++ b/src/dimensions.js
@@ -3,10 +3,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
// margin is only for outerHeight, outerWidth
jQuery.fn[ funcName ] = function( margin, value ) {
- var clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name,
- chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
return jQuery.access( this, function( elem, type, value ) {
@@ -16,7 +13,7 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
// isn't a whole lot we can do. See pull request at this URL for discussion:
// https://github.com/jquery/jquery/pull/764
- return elem.document.documentElement[ clientProp ];
+ return elem.document.documentElement[ "client" + name ];
}
// Get document width or height
@@ -26,9 +23,9 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
return Math.max(
- elem.body[ scrollProp ], doc[ scrollProp ],
- elem.body[ offsetProp ], doc[ offsetProp ],
- doc[ clientProp ]
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
);
}