Currently, I am in the process of revamping a SharePoint 2007 web application to SharePoint 2010.
I was surprised to find that the popup dialog boxes for new items, edit, etc. have inline styles for fixed width and height. Below is an example where div.ms-dlgContent, .ms-dlgBorder, .ms-dlgTitle, and iframe.ms-dlgFrame all have fixed widths set inline.
<div class="ms-dlgContent" role="dialog" aria-labelledby="dialogTitleSpan" tabindex="-1" style="z-index: 1505; display: block; width: 502px; height: 518px; left: 699.5px; top: 10px;">
<div class="ms-dlgBorder" style="width: 500px; height: 516px;">
<div class="ms-dlgTitle" style="width: 500px;">...</div>
<div class="ms-dlgFrameContainer">
<iframe id="GUID" class="ms-dlgFrame" src="/_layouts/listform.aspx?ListId=GUID" frameborder="0" style="width: 500px; height=484px;">...</iframe>
</div>
</div>
</div>
In the browser developer tools, I can manipulate the divs and iframe with jQuery:
$('.ms-dlgContent').css('width','');
$('.ms-dlgBorder').css('width','');
$('.ms-dlgTitle').css('width','');
$('.ms-dlgFrame').width('');
However, correcting the issue this way may not be the most appropriate method. I should focus on getting SharePoint 2010 to correctly size the dialog when it opens.
Since the styles are inline, trying to override them with my custom CSS file will not be effective.
I attempted putting the jQuery in my master page and updating the listform.aspx page with document.ready(...) but as expected, neither approach worked.
If anyone could assist me in either properly sizing the popup dialog using CSS (preferable) or advising where I should place my jQuery code to resize the popup dialog, I would greatly appreciate it.
Thank you in advance.