| 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 |
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
Status:
Accepted
Jun 29, 2009
fixed this in 1.2.1. thanks a lot
Status:
Fixed
Jul 8, 2009
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
(No comment was entered for this change.)
Status:
Implemented
Aug 13, 2013
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |