aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2009-12-21 19:58:13 -0500
committerjeresig <jeresig@gmail.com>2009-12-21 19:58:13 -0500
commit61e37d41490aed319a176c6ca7feb95e5505059c (patch)
tree62b7c9bbb5cba5f15c2a134a51dac84b35e0d0ce /src/css.js
parent36c99dc0c7a745a88488f519b38de811d6d4c8d9 (diff)
downloadjquery-61e37d41490aed319a176c6ca7feb95e5505059c.tar.gz
jquery-61e37d41490aed319a176c6ca7feb95e5505059c.zip
Made a number of spacing changes to bring the code more-inline with the jQuery Core Style Guideline.
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/css.js b/src/css.js
index 5b6b7b9b6..e52e45330 100644
--- a/src/css.js
+++ b/src/css.js
@@ -8,11 +8,15 @@ var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
+ cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+ cssWidth = [ "Left", "Right" ],
+ cssHeight = [ "Top", "Bottom" ],
+
// cache check for defaultView.getComputedStyle
getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
// normalize float css property
styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
- fcamelCase = function(all, letter){
+ fcamelCase = function( all, letter ) {
return letter.toUpperCase();
};
@@ -78,12 +82,14 @@ jQuery.extend({
css: function( elem, name, force, extra ) {
if ( name === "width" || name === "height" ) {
- var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name === "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
+ var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
function getWH() {
val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
- if ( extra === "border" ) { return; }
+ if ( extra === "border" ) {
+ return;
+ }
jQuery.each( which, function() {
if ( !extra ) {