62 lines
2.2 KiB
JavaScript
Executable File
62 lines
2.2 KiB
JavaScript
Executable File
$(document).ready(function () {
|
|
var int_header_height = 10; //put pixel value height of header here
|
|
if ($(document).scrollTop() <= int_header_height) {
|
|
$('#desc').css('position','absolute').css('top','0px');
|
|
} else {
|
|
$('#desc').css('position','fixed').css('top','10px');
|
|
}
|
|
});
|
|
|
|
function setBoxStyle(hour,y_value,cc,id)
|
|
{
|
|
var x=findPosX(document.getElementById("table_day"));
|
|
var y=findPosY(document.getElementById("hour"+hour)); //by id
|
|
//y=y+y_value+184;
|
|
y=y+y_value-1;
|
|
x=x+cc+32;
|
|
document.getElementById("activity"+id).style.position="absolute";
|
|
document.getElementById("activity"+id).style.left=x+"px";
|
|
document.getElementById("activity"+id).style.top=y+"px";
|
|
}
|
|
function resizeHours(hour,hour_height)
|
|
{
|
|
document.getElementById("hour"+hour).style.height=hour_height+"px";
|
|
}
|
|
function getHourPosition(hour,t)
|
|
{
|
|
var v;
|
|
var r=t.rows;
|
|
for(i=0;i<hour;i++)
|
|
{
|
|
v=v+r[i].height;
|
|
}
|
|
return v;
|
|
}
|
|
function showdescriptionCalendar(title,desc,object,pos)
|
|
{
|
|
var div=document.createElement("div");
|
|
|
|
desc=desc.replace("<","<");
|
|
desc=desc.replace(">",">");
|
|
desc=desc.replace(""",'"');
|
|
desc=desc.replace("´","'");
|
|
div.style.display="none";
|
|
div.style.background="#ffffff";
|
|
div.style.position="fixed";
|
|
div.style.bottom = '0%';
|
|
div.style.padding = '10px';
|
|
div.id="desc";
|
|
|
|
div.innerHTML='<table bgcolor="#cccccc" class="olBgClass" border="0" cellpadding="1" cellspacing="1"><tbody><tr><td><table class="olCgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olCgClass" width="100%">'+title+'</td><td align="right"><a href="javascript:hidedescriptionCalendar();" title="Click to Close" onClick="javascript:hidedescription();" class="olCloseFontClass"><img src="themes/Sugar/images/close_inline.gif" border="0"></a></td></tr></tbody></table><table class="olFgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olFgClass" valign="top" background="#ffffff">'+desc+'<br></td></tr></tbody></table></td></tr></tbody></table>';
|
|
|
|
document.body.appendChild(div);
|
|
$('#desc').show();
|
|
}
|
|
function hidedescriptionCalendar()
|
|
{
|
|
if(document.getElementById("desc"))
|
|
{
|
|
document.getElementById("desc").style.display="none";
|
|
document.body.removeChild(document.getElementById("desc"));
|
|
}
|
|
} |