Fix toggling holiday off and on if there is a maximum event limit.
authorJan Schneider <jan@horde.org>
Tue, 10 Aug 2010 22:51:31 +0000 (00:51 +0200)
committerJan Schneider <jan@horde.org>
Tue, 10 Aug 2010 23:28:28 +0000 (01:28 +0200)
kronolith/js/kronolith.js

index e296e81..b38ca82 100644 (file)
@@ -1225,7 +1225,12 @@ KronolithCore = {
                                 }
                             });
                         });
-                        allEvents.invoke('remove');
+                        allEvents.each(function(el) {
+                            if (el.retrieve('calendar').startsWith('holiday|')) {
+                                this.holidays = this.holidays.without(el.retrieve('eventid'));
+                            }
+                            el.remove();
+                        }, this);
                         for (var date = dates[0]; !date.isAfter(dates[1]); date.add(1).days()) {
                             day = this.monthDays['kronolithMonthDay' + date.dateString()];
                             more = day.select('.kronolithMore');