aboutsummaryrefslogtreecommitdiffstats
path: root/src/css.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/css.js
parentf30f7732e7775b6e417c4c22ced7adb2bf76bf89 (diff)
downloadjquery-8f01b92b8fd85a66f2cba671f8b9ff6f7095c34b.tar.gz
jquery-8f01b92b8fd85a66f2cba671f8b9ff6f7095c34b.zip
Follow the style guide, lose 72 bytes! Closes gh-840.
Diffstat (limited to 'src/css.js')
-rw-r--r--src/css.js23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/css.js b/src/css.js
index b1df6d422..2b756c392 100644
--- a/src/css.js
+++ b/src/css.js
@@ -1,6 +1,3 @@
-// order is important!
-jQuery.cssExpand = [ "Top", "Right", "Bottom", "Left" ];
-
var curCSS, iframe, iframeDoc,
ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
@@ -11,7 +8,8 @@ var curCSS, iframe, iframeDoc,
elemdisplay = {},
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssExpand = jQuery.cssExpand,
+ // order is important!
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
rposition = /^(top|right|bottom|left)$/,
@@ -254,8 +252,8 @@ jQuery.extend({
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
- var old = {},
- ret, name;
+ var ret, name,
+ old = {};
// Remember the old values, and insert the new ones
for ( name in options ) {
@@ -304,14 +302,14 @@ if ( window.getComputedStyle ) {
};
} else if ( document.documentElement.currentStyle ) {
curCSS = function( elem, name ) {
- var left, rsLeft, uncomputed,
+ var left, rsLeft,
ret = elem.currentStyle && elem.currentStyle[ name ],
style = elem.style;
// Avoid setting ret to empty string here
// so we don't default to auto
- if ( ret == null && style && (uncomputed = style[ name ]) ) {
- ret = uncomputed;
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
}
// From the awesome hack by Dean Edwards
@@ -555,8 +553,6 @@ jQuery(function() {
return jQuery.swap( elem, { "display": "inline-block" }, function() {
if ( computed ) {
return curCSS( elem, "marginRight" );
- } else {
- return elem.style.marginRight;
}
});
}
@@ -584,10 +580,7 @@ jQuery(function() {
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth,
- height = elem.offsetHeight;
-
- return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+ return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {