Don't overlap events in single day view (code from http://code.google.com/p/fullcalendar/issues/detail?id=218)

This commit is contained in:
Thomas Bruederli 2011-06-20 19:53:00 -06:00
parent 2dc025959c
commit 60635448fb

View file

@ -3803,7 +3803,8 @@ function AgendaEventRenderer() {
height,
slotSegmentContainer = getSlotSegmentContainer(),
rtl, dis, dit,
colCnt = getColCnt();
colCnt = getColCnt(),
overlapping = colCnt > 1;
if (rtl = opt('isRTL')) {
dis = -1;
@ -3830,8 +3831,11 @@ function AgendaEventRenderer() {
outerWidth = availWidth / (levelI + forward + 1);
}else{
if (forward) {
// moderately wide, aligned left still
if (overlapping) { // moderately wide, aligned left still
outerWidth = ((availWidth / (forward + 1)) - (12/2)) * 2; // 12 is the predicted width of resizer =
}else{
outerWidth = outerWidth = availWidth / (forward + 1);
}
}else{
// can be entire width, aligned left
outerWidth = availWidth;
@ -3842,7 +3846,7 @@ function AgendaEventRenderer() {
* dis + (rtl ? availWidth - outerWidth : 0); // rtl
seg.top = top;
seg.left = left;
seg.outerWidth = outerWidth;
seg.outerWidth = outerWidth - (overlapping ? 0 : 1);
seg.outerHeight = bottom - top;
html += slotSegHtml(event, seg);
}