2 commits - plugins/calendar
Thomas Brüderli
bruederli at kolabsys.com
Tue Nov 4 15:10:13 CET 2014
plugins/calendar/calendar_ui.js | 12 ++++++------
plugins/calendar/lib/js/fullcalendar.js | 16 ++++++++++++----
2 files changed, 18 insertions(+), 10 deletions(-)
New commits:
commit 673a5b37e04405f0aa3a3f9a00536bf375169b36
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Tue Nov 4 15:08:03 2014 +0100
Clear events if lazy=false (#3405); update fullcalendar version
diff --git a/plugins/calendar/lib/js/fullcalendar.js b/plugins/calendar/lib/js/fullcalendar.js
index 3389399..a67da0e 100644
--- a/plugins/calendar/lib/js/fullcalendar.js
+++ b/plugins/calendar/lib/js/fullcalendar.js
@@ -1,5 +1,5 @@
/*!
- * FullCalendar v1.6.4-rcube-1.1.2
+ * FullCalendar v1.6.4-rcube-1.1.3
* Docs & License: http://arshaw.com/fullcalendar/
* (c) 2013 Adam Shaw, 2014 Kolab Systems AG
*/
@@ -140,7 +140,7 @@ var rtlDefaults = {
;;
-var fc = $.fullCalendar = { version: "1.6.4-rcube-1.0" };
+var fc = $.fullCalendar = { version: "1.6.4-rcube-1.1.3" };
var fcViews = fc.views = {};
@@ -257,9 +257,9 @@ function Calendar(element, options, eventSources) {
var suggestedViewHeight;
var resizeUID = 0;
var ignoreWindowResize = 0;
+ var lazyRendering = false;
var date = new Date();
var events = [];
- var lazyRendering = false;
var _dragElement;
@@ -512,6 +512,9 @@ function Calendar(element, options, eventSources) {
function refetchEvents(source, lazy) { // can be called as an API method
lazyRendering = lazy || false;
+ if (!lazyRendering) {
+ clearEvents();
+ }
fetchAndRenderEvents(source);
}
commit c4a228ab996c10ceb85c52382d819f5d8e8c0a6d
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date: Tue Nov 4 14:50:05 2014 +0100
Avoid flickering of calendar view when refetching all events (#3405)
diff --git a/plugins/calendar/calendar_ui.js b/plugins/calendar/calendar_ui.js
index 3be3a9d..a5a7838 100644
--- a/plugins/calendar/calendar_ui.js
+++ b/plugins/calendar/calendar_ui.js
@@ -3105,6 +3105,9 @@ function rcube_calendar_ui(settings)
}
}
+ // remove temp events
+ fc.fullCalendar('removeEvents', function(e){ return e.temp; });
+
if (source && (p.refetch || (p.update && !source.active))) {
// activate event source if new event was added to an invisible calendar
if (this.quickview_active) {
@@ -3115,7 +3118,7 @@ function rcube_calendar_ui(settings)
return false;
}
});
- fc.fullCalendar('refetchEvents', source);
+ fc.fullCalendar('refetchEvents', source, true);
}
else if (!source.active) {
source.active = true;
@@ -3123,7 +3126,7 @@ function rcube_calendar_ui(settings)
$('#rcmlical' + source.id + ' input').prop('checked', true);
}
else
- fc.fullCalendar('refetchEvents', source);
+ fc.fullCalendar('refetchEvents', source, true);
fetch_counts();
}
@@ -3147,12 +3150,9 @@ function rcube_calendar_ui(settings)
}
// refetch all calendars
else if (p.refetch) {
- fc.fullCalendar('refetchEvents');
+ fc.fullCalendar('refetchEvents', undefined, true);
fetch_counts();
}
-
- // remove temp events
- fc.fullCalendar('removeEvents', function(e){ return e.temp; });
};
// modify query parameters for refresh requests
diff --git a/plugins/calendar/lib/js/fullcalendar.js b/plugins/calendar/lib/js/fullcalendar.js
index a417a25..3389399 100644
--- a/plugins/calendar/lib/js/fullcalendar.js
+++ b/plugins/calendar/lib/js/fullcalendar.js
@@ -259,6 +259,7 @@ function Calendar(element, options, eventSources) {
var ignoreWindowResize = 0;
var date = new Date();
var events = [];
+ var lazyRendering = false;
var _dragElement;
@@ -509,8 +510,8 @@ function Calendar(element, options, eventSources) {
// TODO: going forward, most of this stuff should be directly handled by the view
- function refetchEvents(source) { // can be called as an API method
- clearEvents();
+ function refetchEvents(source, lazy) { // can be called as an API method
+ lazyRendering = lazy || false;
fetchAndRenderEvents(source);
}
@@ -556,6 +557,10 @@ function Calendar(element, options, eventSources) {
// called when event data arrives
function reportEvents(_events) {
+ if (lazyRendering) {
+ clearEvents();
+ lazyRendering = false;
+ }
events = _events;
renderEvents();
}
More information about the commits
mailing list