Fix width calculation of hidden elements (fixes redbox positioning).
authorJan Schneider <jan@horde.org>
Wed, 14 Apr 2010 15:33:11 +0000 (17:33 +0200)
committerJan Schneider <jan@horde.org>
Wed, 14 Apr 2010 15:33:11 +0000 (17:33 +0200)
See https://prototype.lighthouseapp.com/projects/8886/tickets/1034-layouts-getwidth-calculating-incorrectly-with-hidden-elements-and-auto-width#ticket-1034-1

horde/js/prototype.js

index 99f454a..200a343 100644 (file)
@@ -5173,8 +5173,8 @@ Object.extend(Element.ClassNames.prototype, Enumerable);
         // Either way, it means the element is the width it needs to be
         // in order to report an accurate height.
         newWidth = getPixelValue(width);
-      } else if (width && (position === 'absolute' || position === 'fixed')) {
-        newWidth = getPixelValue(width);
+      } else if (positionedWidth && (position === 'absolute' || position === 'fixed')) {
+        newWidth = getPixelValue(positionedWidth);
       } else {
         // If not, that means the element's width depends upon the width of
         // its parent.