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;
|
var content = http.responseText;
|
||||||
setDateSelectorContent(content);
|
setDateSelectorContent(content);
|
||||||
cachedDateSelectors[http.callbackData] = content;
|
cachedDateSelectors[http.callbackData] = content;
|
||||||
changeCalendarDisplay( { "day": currentDay } );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
log ("dateSelectorCallback Ajax error");
|
log ("dateSelectorCallback Ajax error");
|
||||||
|
@ -822,7 +821,8 @@ function changeCalendarDisplay(data, newView) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scroll to event
|
// Scroll to event
|
||||||
scrollDayView(scrollEvent);
|
if (scrollEvent)
|
||||||
|
scrollDayView(scrollEvent);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -916,19 +916,17 @@ function refreshCalendarEvents(scrollEvent) {
|
||||||
var todayDate = new Date();
|
var todayDate = new Date();
|
||||||
var sd;
|
var sd;
|
||||||
var ed;
|
var ed;
|
||||||
|
|
||||||
|
if (!currentDay)
|
||||||
|
currentDay = todayDate.getDayString();
|
||||||
|
|
||||||
if (currentView == "dayview") {
|
if (currentView == "dayview") {
|
||||||
if (currentDay)
|
sd = currentDay;
|
||||||
sd = currentDay;
|
|
||||||
else
|
|
||||||
sd = todayDate.getDayString();
|
|
||||||
ed = sd;
|
ed = sd;
|
||||||
}
|
}
|
||||||
else if (currentView == "weekview") {
|
else if (currentView == "weekview") {
|
||||||
var startDate;
|
var startDate;
|
||||||
if (currentDay)
|
startDate = currentDay.asDate();
|
||||||
startDate = currentDay.asDate();
|
|
||||||
else
|
|
||||||
startDate = todayDate;
|
|
||||||
startDate = startDate.beginOfWeek();
|
startDate = startDate.beginOfWeek();
|
||||||
sd = startDate.getDayString();
|
sd = startDate.getDayString();
|
||||||
var endDate = new Date();
|
var endDate = new Date();
|
||||||
|
@ -938,10 +936,7 @@ function refreshCalendarEvents(scrollEvent) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var monthDate;
|
var monthDate;
|
||||||
if (currentDay)
|
monthDate = currentDay.asDate();
|
||||||
monthDate = currentDay.asDate();
|
|
||||||
else
|
|
||||||
monthDate = todayDate;
|
|
||||||
monthDate.setDate(1);
|
monthDate.setDate(1);
|
||||||
sd = monthDate.beginOfWeek().getDayString();
|
sd = monthDate.beginOfWeek().getDayString();
|
||||||
|
|
||||||
|
@ -1155,12 +1150,11 @@ function calendarDisplayCallback(http) {
|
||||||
var daysView = $("daysView");
|
var daysView = $("daysView");
|
||||||
var position = -1;
|
var position = -1;
|
||||||
|
|
||||||
|
// Check the previous view to restore the scrolling position
|
||||||
if (daysView)
|
if (daysView)
|
||||||
position = daysView.scrollTop;
|
position = daysView.scrollTop;
|
||||||
|
preventAutoScroll = (position != -1);
|
||||||
if (position != -1)
|
|
||||||
preventAutoScroll = true;
|
|
||||||
|
|
||||||
if (http.readyState == 4
|
if (http.readyState == 4
|
||||||
&& http.status == 200) {
|
&& http.status == 200) {
|
||||||
document.dayDisplayAjaxRequest = null;
|
document.dayDisplayAjaxRequest = null;
|
||||||
|
|
Loading…
Reference in New Issue