propagate from branch 'ca.inverse.sogo.1_3_15' (head 9cc6d172992d23b089ad2377f66d83c176dc0fed)

to branch 'ca.inverse.sogo' (head 21360eb0c3f218f331f1eba36a06224f3429cd91)

Monotone-Parent: 21360eb0c3f218f331f1eba36a06224f3429cd91
Monotone-Parent: 9cc6d172992d23b089ad2377f66d83c176dc0fed
Monotone-Revision: 356e7649cb18120413fdf16e371d74fbcd28c3e1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-24T18:00:56
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2012-04-24 18:00:56 +00:00
commit dcef24cc15
3 changed files with 54 additions and 7 deletions

View file

@ -3,6 +3,10 @@
* UI/WebServerResources/SchedulerUI.js (updateCalendarStatus): if * UI/WebServerResources/SchedulerUI.js (updateCalendarStatus): if
"event" is set, we set its returnValue to true, to avoid a bug "event" is set, we set its returnValue to true, to avoid a bug
occurring since the use of "clickEventWrapper". occurring since the use of "clickEventWrapper".
(resizeCalendarHeaderDIV): new function that resizes the all-day
event containers progressively.
(_drawCalendarAllDayEvents, _deleteCalendarEventBlocks): invoke
the above.
* UI/WebServerResources/HTMLElement.js: get "HTMLCollection" * UI/WebServerResources/HTMLElement.js: get "HTMLCollection"
and "NodeList" classes by class rather than by direct reference. and "NodeList" classes by class rather than by direct reference.

View file

@ -412,7 +412,6 @@ DIV#calendarHeader,
DIV#daysView DIV#daysView
{ position: absolute; { position: absolute;
top: 0px; top: 0px;
bottom: 0px;
left: 0px; } left: 0px; }
DIV#daysView DIV#daysView
@ -426,8 +425,8 @@ DIV#daysView
DIV#calendarHeader DIV#calendarHeader
{ top: 50px; { top: 50px;
border: 0px; border: 0px;
right: 0px; height: 100px;
height: 70px; } right: 0px; }
DIV#calendarHeader DIV.dayLabels, DIV#calendarHeader DIV.dayLabels,
DIV#calendarHeader DIV.days DIV#calendarHeader DIV.days
@ -439,7 +438,7 @@ DIV#calendarHeader DIV.days
overflow: hidden; } overflow: hidden; }
DIV#calendarHeader DIV.dayLabels DIV#calendarHeader DIV.dayLabels
{ bottom: 40px; { top: 0px;
height: 35px; } height: 35px; }
DIV#calendarHeader DIV.dayLabels DIV.day DIV#calendarHeader DIV.dayLabels DIV.day
@ -456,7 +455,7 @@ DIV#calendarHeader DIV.dayLabels
DIV#calendarHeader DIV.days DIV#calendarHeader DIV.days
{ cursor: pointer; { cursor: pointer;
bottom: 0px; bottom: 0px;
height: 40px; } top: 35px; }
DIV#calendarHeader DIV.day, DIV#calendarHeader DIV.day,
DIV#daysView DIV.day DIV#daysView DIV.day

View file

@ -520,6 +520,8 @@ function _deleteCalendarEventBlocks(calendar, cname, occurenceTime) {
} }
} }
} }
resizeCalendarHeaderDIV();
} }
function _deleteEventFromTables(calendar, cname, occurenceTime) { function _deleteEventFromTables(calendar, cname, occurenceTime) {
@ -1687,8 +1689,8 @@ function newBaseEventDIV(eventRep, event, eventText) {
} }
function _drawCalendarAllDayEvents(events, eventsData) { function _drawCalendarAllDayEvents(events, eventsData) {
var daysView = $("calendarHeader"); var headerView = $("calendarHeader");
var subdivs = daysView.childNodesWithTag("div"); var subdivs = headerView.childNodesWithTag("div");
var days = subdivs[1].childNodesWithTag("div"); var days = subdivs[1].childNodesWithTag("div");
for (var i = 0; i < days.length; i++) { for (var i = 0; i < days.length; i++) {
var parentDiv = days[i]; var parentDiv = days[i];
@ -1699,6 +1701,48 @@ function _drawCalendarAllDayEvents(events, eventsData) {
parentDiv.appendChild(eventCell); parentDiv.appendChild(eventCell);
} }
} }
resizeCalendarHeaderDIV();
}
/* When the list of all day events overflows, we resize it in order to contain
at least 6 or 7 items. Afterwards we restore the regular scrollbar
mechanism. */
function resizeCalendarHeaderDIV() {
var headerView = $("calendarHeader");
var daysView = $("daysView");
if (headerView && daysView) {
/* consts */
var headerViewBaseHeight = 70;
var daysViewBaseTop = 120;
var maxDelta = 80;
/* /consts */
var maxEventPerDay = 0;
var subdivs = headerView.childNodesWithTag("div");
var days = subdivs[1].childNodesWithTag("div");
for (var i = 0; i < days.length; i++) {
var parentDiv = days[i];
var divs = parentDiv.childNodesWithTag("div");
if (divs.length > maxEventPerDay) {
maxEventPerDay = divs.length;
}
}
if (maxEventPerDay > 2) {
var delta = ((maxEventPerDay - 2) * 22) + 10;
if (delta > maxDelta) {
delta = maxDelta;
}
daysView.style.top = String(delta + daysViewBaseTop) + "px";
headerView.style.height = String(delta + headerViewBaseHeight) + "px";
}
else {
daysView.style.top = null;
headerView.style.height = null;
}
}
} }
function newAllDayEventDIV(eventRep, event) { function newAllDayEventDIV(eventRep, event) {