]> source.dussan.org Git - jquery.git/commitdiff
Small optimization to jQuery.css to save 12 bytes
authorBrandon Aaron <brandon.aaron@gmail.com>
Tue, 3 Apr 2007 03:04:38 +0000 (03:04 +0000)
committerBrandon Aaron <brandon.aaron@gmail.com>
Tue, 3 Apr 2007 03:04:38 +0000 (03:04 +0000)
src/jquery/jquery.js

index ddb08a4381f980e417d8ca22552b92ff97b41d09..715fbf11016255869b0e686ffa0d17cc14a12432 100644 (file)
@@ -1373,7 +1373,7 @@ jQuery.extend({
                        });
 
                        jQuery.swap( e, old, function() {
-                               if (jQuery.css(e,"display") != "none") {
+                               if ( jQuery(e).is(':visible') ) {
                                        oHeight = e.offsetHeight;
                                        oWidth = e.offsetWidth;
                                } else {
@@ -1383,14 +1383,14 @@ jQuery.extend({
                                                        visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0"
                                                }).appendTo(e.parentNode)[0];
 
-                                       var parPos = jQuery.css(e.parentNode,"position");
-                                       if ( parPos == "" || parPos == "static" )
+                                       var parPos = jQuery.css(e.parentNode,"position") || "static";
+                                       if ( parPos == "static" )
                                                e.parentNode.style.position = "relative";
 
                                        oHeight = e.clientHeight;
                                        oWidth = e.clientWidth;
 
-                                       if ( parPos == "" || parPos == "static" )
+                                       if ( parPos == "static" )
                                                e.parentNode.style.position = "static";
 
                                        e.parentNode.removeChild(e);