My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 42: Loading indicator ends prematurely when doing multiple addEventSource calls
1 person starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Aug 2013


Sign in to add a comment
 
Reported by yowza...@gmail.com, Jun 17, 2009
I have a script that adds several sources to the calendar. This is executed
when a user selects an option in the UI to "show other events".  It looks
something like this:

cal.fullCalendar('addEventSource','/json/'+username+'/a');
cal.fullCalendar('addEventSource','/json/'+username+'/b');
cal.fullCalendar('addEventSource','/json/'+username+'/c');
cal.fullCalendar('addEventSource','/json/'+username+'/d');

The problem is that the following FC code changes options.loading back to
false as soon as the first source is finished adding.  The other sources
are still being added, but options.loading is now false.

addEventSource: function(src) {
	eventSources.push(src);
	if (options.loading) {
		options.loading(true);
	}
	fetchEventSource(src, function() {
		if (options.loading) {
			options.loading(false);
		}
		clearEventElements();
		renderEvents();
	});
},


Jun 19, 2009
Project Member #1 adamrs...@gmail.com
ah i see, so fullcalendar needs to keep track of which event sources it is waiting on
so it knows when they are ALL done. this is a legit bug, thanks. i will fix this in
the next patch release. thanks.
Status: Accepted
Jun 29, 2009
Project Member #2 adamrs...@gmail.com
fixed this in 1.2.1. thanks a lot
Status: Fixed
Jul 8, 2009
#3 yowza...@gmail.com
Thanks for working on this. However, I still think it isn't quite right.  To test,
I'm using this with several google calendar sources:

	loading: function(bool) {
		if (bool) alert("Loading");
		else alert("Finished");
	}

I don't get consistent results. Sometimes I get multiple "Loading" and "Finished"
alerts, and the number of each doesn't always match.  I'm guessing this is because
things are happening asynchronously so your push/pop logic is reaching 0 several times. 

The issue really rear's its ugly head when I'm using a veil to disable the use of the
calendar while it is loading.  This is just putting a transparent div over the top of
the calendar area so that nothing in it can be clicked during load:

	loading: function(bool) {
		if (bool) $('#veil').show();
		else $('#veil').hide();
	}

When I do this, the veil turns on and off a couple times during the load. And the
veil is left over the calendar when the loading has completed, making the calendar
unusable.

I hope this helps!

Aug 13, 2013
Project Member #4 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Implemented
Aug 13, 2013
Project Member #5 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting