fixed another problem with event fetching

This commit is contained in:
Adam Shaw 2010-10-16 17:09:29 -07:00
parent 45044c5a5d
commit b21736be4d

View file

@ -74,11 +74,15 @@ function EventManager(options, eventSources) {
function fetchEventSources(sources, callback) { function fetchEventSources(sources, callback) {
var savedID = ++fetchID; var savedID = ++fetchID;
var queued = sources.length; var queued = sources.length;
var view = getView(); var origView = getView();
eventStart = cloneDate(view.visStart); // we don't need to make local copies b/c eventStart = cloneDate(origView.visStart); // we don't need to make local copies b/c
eventEnd = cloneDate(view.visEnd); // eventStart/eventEnd is only assigned/manipulated here eventEnd = cloneDate(origView.visEnd); // eventStart/eventEnd is only assigned/manipulated here
function sourceDone(source, sourceEvents) { function sourceDone(source, sourceEvents) {
if (savedID == fetchID && eventStart >= view.visStart && eventEnd <= view.visEnd) { var currentView = getView();
if (origView != currentView) {
origView.eventsDirty = true; // sort of a hack
}
if (savedID == fetchID && eventStart <= currentView.visStart && eventEnd >= currentView.visEnd) {
// same fetchEventSources call, and still in correct date range // same fetchEventSources call, and still in correct date range
if ($.inArray(source, eventSources) != -1) { // source hasn't been removed since we started if ($.inArray(source, eventSources) != -1) { // source hasn't been removed since we started
for (var i=0; i<sourceEvents.length; i++) { for (var i=0; i<sourceEvents.length; i++) {