simplemodal icon indicating copy to clipboard operation
simplemodal copied to clipboard

Added minimum left and top properties for positioning the dialog

Open jasonseney opened this issue 15 years ago • 3 comments

Hey Eric, I noticed that if you size down the browser, it doesn't constrain the top or left position properties. This causes the dialog to be positioned "off screen" in a window that is shorter or narrower than the centered dialog.

I added two options for minLeft and minTop (with generic defaults of 0) to check against when calculating position.

Hope you find this as useful as I did, thanks!

jasonseney avatar Mar 31 '11 20:03 jasonseney

Thanks Jason! I hope to find some time soon to review a few changes and get a new version out.

ericmmartin avatar Apr 05 '11 21:04 ericmmartin

Hi Jason, thanks for the contribution. Do you think it is necessary to create additional options, or could this be "hard-coded" to keep the dialog within window boundaries?

ericmmartin avatar Jun 14 '11 15:06 ericmmartin

I think it at a minimum it should simply constrain to the window boundaries (0,0). I added the option since I wanted additional margins between my modal dialog and the window so the user with a small window would be able to see some of the overlay on the left and top.

I can understand you wouldn't want the option list to grow out of control, and personally I think "hard-coding" it in for now would be the most important to update. Could always go back and add the additional options later if other users bring it up.

jasonseney avatar Jun 14 '11 18:06 jasonseney