Modal box resizing problem

90 views
Skip to first unread message

azlists

unread,
Jun 15, 2011, 8:11:57 PM6/15/11
to ModalBox
Hi !

I think there is a small problem on window resizing when chaining
multiple modal windows (wizzard style).
When having the first window being scrollable, the second modal
window does not automagically resise to fit content. The size is fixed
to the size of the first modal. This is true whether we use a fixed
height, or let the height be calculated automatically.


To reproduce the problem do the following :


var someLenghyListContainer = new Element('div', {'id',
'someLenghyListContainer'});
for(var i =0; i<100; i++){
var elemCont = new Element('div', {'id', 'elem'+i});
var elemTit = new Element('div', {'id',
'elemTit'+i}).update('TITLE OF ' +i);
var elemDesc= new Element('div', {'id',
'elemDesc'+i}).update('SOME LENGHY DESCRIPTION SO THAT WE HAVE
SOMETHING BLABLABLABLALBA OF ' +i);
elemCont.insert(elemTit );
elemCont.insert(elemDesc);
someLenghyListContainer.insert(elemCont);
}
someLenghyListContainer.insert(new Element('input', {'type':'button',
'id':'mySexyButton'});

Modalbox.show(someLenghyListContainer, { title: "My BIG LIST !! ",
width: 500,height : 600, afterLoad : function(){
Event.observe($('mySexyButton'), 'click',
function(){ Modalbox.show(someSmallContainer, { title: "My SMALL
Container !! "});
} //
click
);//observe

}//afterload
});




someLenghyListContainer is a DOM Element that contains a lengthy list
of elements in such a way that the modal needs to scroll.
mySexyButton is a button that is inside someLenghyListContainer . when
clicked a second modal pops.
someSmallContainer is a small DOM Element that should perfectly fit
inside the screen.

The expected behaviour would be to have the second modal animate to
resize to fit the small content. this is not the case (at least as
tested on FireFox 4.0.1 today) .

As side note also :
if height option is not set in the first modal (i.e. height : 600)
the automatic calculation of heigh is buggy as the last elements of
the list are not reachable because there is a scrolling problem ...


How can I fix this ?

Should I file an issue in github ?

Sorrrrrrry for the formatting ... ;-)

Many thanks in advance for your feedback !




azlists

unread,
Jun 25, 2011, 8:40:52 PM6/25/11
to ModalBox
Can anybody help on this ?


Are you guys able to reproduce the problem ?


Thank you for giving some feedback !


Cheers,

Alex

Justinas Urbanavicius

unread,
Jun 26, 2011, 8:35:53 AM6/26/11
to moda...@googlegroups.com
when initializing a second modalbox try calling

resizeToContent

https://github.com/okonet/modalbox/wiki/Methods-reference


--
You received this message because you are subscribed to the Google Groups "ModalBox" group.
To post to this group, send email to moda...@googlegroups.com.
To unsubscribe from this group, send email to modalbox+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/modalbox?hl=en.




--
Justinas

Reply all
Reply to author
Forward
0 new messages