Download & Extend

Reposition popup when browser window is resized

Project:Popups API (Ajax Dialogs)
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

When resizing the browser window with a popup open the popup window is not repositioned and the overlay does not cover the full window. Looking at how a couple of modules handle this Lightbox2 takes the same approach (with the same limitation) as Popups API. On the other hand Thickbox makes the overlay 100% wide and positions the popup at 50% wide by 50% tall and then uses negative margins of half the popup size which keeps the popup centered even when the window is resized.

In some searching I didn't find a compelling argument for not doing this in the way Thickbox does. Is there any reason Popups API shouldn't move in this direction.

AttachmentSize
Popups resized PNG165.08 KB

Comments

#1

Links to Thickbox and Lightbox2 demo sites for comparison

http://jquery.com/demo/thickbox/
http://www.stellapower.net/lightbox2

#2

Status:active» needs review

Here's a first-round patch that does this. If the module moves this way we can probably remove the top and left variables as well.

AttachmentSize
popups-519014.patch 805 bytes

#3

Oops silly mistake forgot to include the overlay width.

AttachmentSize
popups-519014-3.patch 1.19 KB
nobody click here