Problem removing event sources from FullCalendar (jQuery)

In this case, I use FullCalendar to display events from several sources, some local JSON channels, others from Google Calendar. I implemented a function in which one calendar can be displayed / hidden when it is true or false, respectively.

I use this code to achieve it:

$('#calendar_list input','#sidebar').live('click', function() {
    if($(this).is(":checked")==true) {
        // display the calendar     
        var source = $.fullCalendar.gcalFeed("http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic");
        $('#calendar').fullCalendar('addEventSource', source);
    } else {
        // remove the calendar
        var source = $.fullCalendar.gcalFeed("http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic");
        $('#calendar').fullCalendar('removeEventSource', source);
    }
});

In this example, if you just show / hide the Google Calendar feed, the problem is that it never hides the calendar again ... if I click on the checkbox 10 times (1 = off, 2 = on, 3 = off, 4 = etc.) It displays 5 versions of the same calendar.

, , , Google Project .

? * *

.

+5
2

, , Google Project , - , , :

/URL/. .

, , , , , , /getEvents.php, , .

( ), / , .

+8
+1

All Articles