The following patch update the getPageSize() function in lightbox.js to match the upstream implementation.

Why does it matters? On firefox mac (at least), the width of the overlay div is consistently too large by the size of the scrollbar. This provoke the apparition of an horizontal sidebar in the browser.

The critical change is:

     // For small pages with total width less then width of the viewport.
     if (xScroll < windowWidth) {
-      pageWidth = windowWidth;
+      pageWidth = xScroll;
     }
     else {
-      pageWidth = xScroll;
+      pageWidth = windowWidth;
     }

I know that just above that chunk, the code does the opposite for the height. But *alas* this matches what upstream does (in the latest 2.04 version).

This should also apply to the 6.x version.

CommentFileSizeAuthor
lightbox-getPageSize-fix.patch1.67 KBdamien tournoud

Comments

stella’s picture

Status: Needs review » Closed (duplicate)
kuakuak’s picture

Thanks, it worked (6.x), this was also happening in windows and linux. Tested in windows and linux with Firefox 2.0 and 3.0.
Thanks again!!!