Monotone-Parent: a67a6a3249b2b6a4b199678bc6f32cad47300639

Monotone-Revision: 9cc6d172992d23b089ad2377f66d83c176dc0fed

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-24T18:00:49
maint-2.0.2
Wolfgang Sourdeau 2012-04-24 18:00:49 +00:00
parent 45a9a751ea
commit ca8fbfe942
3 changed files with 54 additions and 7 deletions

View File

@ -3,6 +3,10 @@
* UI/WebServerResources/SchedulerUI.js (updateCalendarStatus): if
"event" is set, we set its returnValue to true, to avoid a bug
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"
and "NodeList" classes by class rather than by direct reference.

View File

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

View File

@ -520,6 +520,8 @@ function _deleteCalendarEventBlocks(calendar, cname, occurenceTime) {
}
}
}
resizeCalendarHeaderDIV();
}
function _deleteEventFromTables(calendar, cname, occurenceTime) {
@ -1687,8 +1689,8 @@ function newBaseEventDIV(eventRep, event, eventText) {
}
function _drawCalendarAllDayEvents(events, eventsData) {
var daysView = $("calendarHeader");
var subdivs = daysView.childNodesWithTag("div");
var headerView = $("calendarHeader");
var subdivs = headerView.childNodesWithTag("div");
var days = subdivs[1].childNodesWithTag("div");
for (var i = 0; i < days.length; i++) {
var parentDiv = days[i];
@ -1699,6 +1701,48 @@ function _drawCalendarAllDayEvents(events, eventsData) {
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) {