Closed burtnoir closed 8 years ago
The issue behind this seems to be that you never really know how a browser calculates the dimensions when setting width/height to auto. To solve this you should set widht and/or height of the content section to auto after inserting new content and before resizing the complete panel. The following example seems to work fine but I quickly tested this only on FF:
var test = $.jsPanel({
paneltype: 'modal',
contentSize: '400 50'
});
window.setTimeout(function() {
test.content.append("<ol><li>Item</li><li>Item</li><li>Item</li><li>Item</li><li>Item</li></ol>");
test.content.css({width:'auto', height:'auto', padding: '10px'});
test.resize(null, 'auto').reposition();
}, 1000);
Thanks for your help, I'll give that a try.
I can confirm that this approach works so I just need to make sure I always do this after I change the content of a modal panel.
I am using the resize method to deal with changing content. It works well on normal panels using specific values and the 'auto' value.
On a modal panel I find that I cannot set the height to 'auto'. There's no error, it just doesn't appear to do anything. I can set the width to 'auto'. I even tried resizing the modal dialog example after inserting some extra content and it shows the same behaviour.
Am I missing something?
Thanks