adapt height in Stylite, idots AND jerryr template for emailmodule (provided by Chr.Fueller, adapted for jerryr by leithoff, partially ported from igel457 previous work on default template)

This commit is contained in:
Klaus Leithoff 2010-07-01 10:01:57 +00:00
parent 78cd375dc7
commit d12978851d
2 changed files with 70 additions and 3 deletions

View File

@ -165,11 +165,11 @@ fm_startTimerMessageListUpdate(refreshTimeOut);
if the iframe stays maximized. */ if the iframe stays maximized. */
if (window.parent && typeof window.parent.framework != 'undefined') if (window.parent && typeof window.parent.framework != 'undefined')
{ {
var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 58; var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 70;
} }
else else
{ {
var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 75; var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 90;
} }
/* Tableheight specifies the rendered size of the table, /* Tableheight specifies the rendered size of the table,

View File

@ -143,13 +143,80 @@ fm_startTimerMessageListUpdate(refreshTimeOut);
<!-- BEGIN message_table --> <!-- BEGIN message_table -->
<div id="divMessageTableList" style="overflow:auto; height:{messagelist_height}; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom: 0px; z-index:90; border : 1px solid #9f9f9f; border-top: 0px; background-color: white;"> <div id="divMessageTableList" style="overflow:auto; height:{messagelist_height}; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom: 0px; z-index:90; border : 1px solid #9f9f9f; border-top: 0px; background-color: white;">
<table BORDER="0" style="width:98%; padding-left:2; table-layout: fixed;" cellspacing="0"> <table id="tableMessageTableList" BORDER="0" style="width:98%; padding-left:2; table-layout: fixed;" cellspacing="0">
{message_rows} {message_rows}
</table> </table>
</div> </div>
<span id="spanMessagePreview"> <span id="spanMessagePreview">
{IFrameForPreview} {IFrameForPreview}
</span> </span>
<script type="text/javascript">
var felamimail_iframe_height = parseInt("{messagelist_height}".replace(/px/g,""));
function handleResize()
{
/* Constant values */
var MIN_TABLE_HEIGHT = 100;
var MAX_TABLE_WHITESPACE = 25;
var divMessageTableList = document.getElementById('divMessageTableList');
var iframe = document.getElementById('messageIFRAME');
var tdiframe = document.getElementById('tdmessageIFRAME');
var tableMessageTableList = document.getElementById('tableMessageTableList');
if (typeof divMessageTableList != 'undefined')
{
/* The height parameter specifies how many height is left for the message list
if the iframe stays maximized. */
if (window.parent && typeof window.parent.framework != 'undefined') /* jdots template, does not apply here, as it is using default templates */
{
var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 85;
}
else
{
var height = $(window).height() - felamimail_iframe_height - $(divMessageTableList).offset().top - 112;
}
/* Tableheight specifies the rendered size of the table,
iframeheight the height of the message preview,
divheight the end size height of the table outer div */
var tableheight = $(tableMessageTableList).height();
var iframeheight = felamimail_iframe_height;
var divheight = height;
/* If the remaining height is smaller than MIN_TABLE_HEIGHT, the iframe
will be scaled to a smaller size */
if (height < MIN_TABLE_HEIGHT)
{
divheight = MIN_TABLE_HEIGHT;
iframeheight = iframeheight + (height - MIN_TABLE_HEIGHT);
}
/* If the divheight is grater than the actual size of the message table,
scale the divheight smaller and increase the size of the iframe */
if (divheight > tableheight + MAX_TABLE_WHITESPACE)
{
var oh = divheight;
divheight = tableheight + MAX_TABLE_WHITESPACE;
iframeheight = iframeheight + (oh - divheight);
}
/* Set the sizes */
divMessageTableList.style.height = divheight + 'px';
if (typeof iframe != 'undefined' && typeof tdiframe != 'undefined')
{
tdiframe.height = iframeheight;
iframe.height = iframeheight;
}
}
}
//Resize the elements
handleResize();
//Assign the handle resize
$(window).resize(handleResize);
</script>
<!-- END message_table --> <!-- END message_table -->
<!-- BEGIN status_row_tpl --> <!-- BEGIN status_row_tpl -->