mohit1982 / simplemodal

Automatically exported from code.google.com/p/simplemodal
0 stars 0 forks source link

auto position results in incorrect position #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. set position: null or omit
2. open a modal box

What is the expected output? What do you see instead?
box should be centered, box will have top/left set to 50% of window but
since this.dialog.container does not yet have dimensions, hCenter and
vCenter will have incorrect offsets

What version of the product are you using? On what operating system?
xp - firefox 3

Please provide any additional information below.
line 338: the modal contents im using have width and height css properties
set so i changed 338 & 339 to
        hCenter = (w[0]/2) - (this.dialog.data.height()/2),
        vCenter = (w[1]/2) - (this.dialog.data.width()/2);

but this is not a general solution

Original issue reported on code.google.com by calderon...@gmail.com on 5 Dec 2008 at 7:40

GoogleCodeExporter commented 8 years ago
I added a "fix" that uses data height/width if the container height/width does 
not
exist. There will still be an issue if neither has a value - I probably should 
add a
default.

hCenter = (w[0]/2) - ((this.dialog.container.height() || 
this.dialog.data.height())/2),
vCenter = (w[1]/2) - ((this.dialog.container.width() || 
this.dialog.data.width())/2);

Try out 1.2.1 and see if that works for you.

Original comment by emartin24 on 5 Dec 2008 at 10:41

GoogleCodeExporter commented 8 years ago

Original comment by emartin24 on 5 Dec 2008 at 10:47