Fix scrolling issues and useless Ajax calls in Calendar web view
Monotone-Parent: fa7d871f17a70530eb91cb1db11d03a8fa643108 Monotone-Revision: a8698cc119066cef660b176c3e956b5d0d843e7f Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-08-27T16:51:30 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
4803ab33b9
commit
a38722d9cb
|
@ -562,7 +562,6 @@ function dateSelectorCallback(http) {
|
|||
var content = http.responseText;
|
||||
setDateSelectorContent(content);
|
||||
cachedDateSelectors[http.callbackData] = content;
|
||||
changeCalendarDisplay( { "day": currentDay } );
|
||||
}
|
||||
else
|
||||
log ("dateSelectorCallback Ajax error");
|
||||
|
@ -822,7 +821,8 @@ function changeCalendarDisplay(data, newView) {
|
|||
}
|
||||
|
||||
// Scroll to event
|
||||
scrollDayView(scrollEvent);
|
||||
if (scrollEvent)
|
||||
scrollDayView(scrollEvent);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -916,19 +916,17 @@ function refreshCalendarEvents(scrollEvent) {
|
|||
var todayDate = new Date();
|
||||
var sd;
|
||||
var ed;
|
||||
|
||||
if (!currentDay)
|
||||
currentDay = todayDate.getDayString();
|
||||
|
||||
if (currentView == "dayview") {
|
||||
if (currentDay)
|
||||
sd = currentDay;
|
||||
else
|
||||
sd = todayDate.getDayString();
|
||||
sd = currentDay;
|
||||
ed = sd;
|
||||
}
|
||||
else if (currentView == "weekview") {
|
||||
var startDate;
|
||||
if (currentDay)
|
||||
startDate = currentDay.asDate();
|
||||
else
|
||||
startDate = todayDate;
|
||||
startDate = currentDay.asDate();
|
||||
startDate = startDate.beginOfWeek();
|
||||
sd = startDate.getDayString();
|
||||
var endDate = new Date();
|
||||
|
@ -938,10 +936,7 @@ function refreshCalendarEvents(scrollEvent) {
|
|||
}
|
||||
else {
|
||||
var monthDate;
|
||||
if (currentDay)
|
||||
monthDate = currentDay.asDate();
|
||||
else
|
||||
monthDate = todayDate;
|
||||
monthDate = currentDay.asDate();
|
||||
monthDate.setDate(1);
|
||||
sd = monthDate.beginOfWeek().getDayString();
|
||||
|
||||
|
@ -1155,11 +1150,10 @@ function calendarDisplayCallback(http) {
|
|||
var daysView = $("daysView");
|
||||
var position = -1;
|
||||
|
||||
// Check the previous view to restore the scrolling position
|
||||
if (daysView)
|
||||
position = daysView.scrollTop;
|
||||
|
||||
if (position != -1)
|
||||
preventAutoScroll = true;
|
||||
preventAutoScroll = (position != -1);
|
||||
|
||||
if (http.readyState == 4
|
||||
&& http.status == 200) {
|
||||
|
|
Loading…
Reference in New Issue