Fix position of red "now" line

Fixes #2373
pull/13/head
Francis Lachapelle 2013-08-27 09:04:26 -04:00
parent 0a590ba388
commit df1ab29872
2 changed files with 32 additions and 31 deletions

1
NEWS
View File

@ -9,6 +9,7 @@ Enhancements
Bug fixes
- fixed Finnish mail reply/forward templates
- fixed position of red line of current time
2.0.7 (2013-07-19)
------------------

View File

@ -3262,39 +3262,39 @@ function onWindowResize(event) {
}
function drawNowLine() {
var d = new Date();
var hours = d.getHours();
var minutes = d.getMinutes();
var d = new Date();
var hours = d.getHours();
var minutes = d.getMinutes();
if (currentView == "dayview") {
var today = new Date();
var m = parseInt(today.getMonth()) + 1;
var d = today.getDate();
if (m < 10)
m = "0" + m;
if (d < 10)
d = "0" + d;
var day = today.getFullYear() + "" + m + "" + d;
var targets = $$("DIV#daysView DIV.days DIV.day[day=" + day
+ "] DIV.clickableHourCell");
}
else if (currentView == "weekview")
var targets = $$("DIV#daysView DIV.days DIV.dayOfToday DIV.clickableHourCell");
if (targets) {
var target = targets[hours];
if (target) {
var div = $("nowLineDisplay");
if (!div)
div = new Element("div", {'id': 'nowLineDisplay'});
div.style.top = parseInt(((minutes * target.offsetHeight) / 60) - 1) + "px";
target.appendChild(div);
setTimeout("drawNowLine ();", 60000); // 1 min.
if (currentView == "dayview") {
var today = new Date();
var m = parseInt(today.getMonth()) + 1;
var d = today.getDate();
if (m < 10)
m = "0" + m;
if (d < 10)
d = "0" + d;
var day = today.getFullYear() + "" + m + "" + d;
var targets = $$("DIV#daysView DIV.days DIV.day[day=" + day
+ "] DIV.clickableHourCell");
}
else if (currentView == "weekview")
var targets = $$("DIV#daysView DIV.days DIV.dayOfToday DIV.clickableHourCell");
if (targets) {
var target = targets[hours];
if (target) {
var div = $("nowLineDisplay");
if (!div)
div = new Element("div", {'id': 'nowLineDisplay'});
div.style.top = parseInt((minutes * target.offsetHeight / 60) - 1) + "px";
target.insertBefore(div, target.firstChild);
setTimeout("drawNowLine ();", 60000); // 1 min.
}
}
}
}
function onListCollapse(event, element) {