Skip to content

Commit

Permalink
fixed another problem with event fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
arshaw committed Oct 17, 2010
1 parent 45044c5 commit b21736b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/EventManager.js
Expand Up @@ -74,11 +74,15 @@ function EventManager(options, eventSources) {
function fetchEventSources(sources, callback) {
var savedID = ++fetchID;
var queued = sources.length;
var view = getView();
eventStart = cloneDate(view.visStart); // we don't need to make local copies b/c
eventEnd = cloneDate(view.visEnd); // eventStart/eventEnd is only assigned/manipulated here
var origView = getView();
eventStart = cloneDate(origView.visStart); // we don't need to make local copies b/c
eventEnd = cloneDate(origView.visEnd); // eventStart/eventEnd is only assigned/manipulated here
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
if ($.inArray(source, eventSources) != -1) { // source hasn't been removed since we started
for (var i=0; i<sourceEvents.length; i++) {
Expand Down

0 comments on commit b21736b

Please sign in to comment.