Skip to content

Commit 26fcda2

Browse files
author
Jelte Lagendijk
committed
Fix #45 - scrolltime for AgendaWeek & AgendaDay
1 parent 81eb1ea commit 26fcda2

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "calendar",
3-
"version": "5.3.0",
3+
"version": "5.3.1",
44
"description": "This is a calendar widget for Mendix. It shows a Calendar and can render objects as events in it.",
55
"license": "Apache License, Version 2.0, January 2004",
66
"author": "Mendix 2016",

src/calendar/widget/calendar.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ define([
9797
this._fcNode.fullCalendar("render");
9898
this._fcNode.fullCalendar("refetchEvents");
9999
this._timeout = null;
100-
}), 100);
100+
}), 50);
101101
},
102102

103103
_setSchedulerOptions: function(options) {
@@ -431,6 +431,10 @@ define([
431431
} else {
432432
this._fcNode.fullCalendar("gotoDate", new Date());
433433
}
434+
435+
window._refreshCal = lang.hitch(this, function () {
436+
this._fcNode.fullCalendar("refetchEvents");
437+
});
434438
},
435439

436440
_onEventChange: function(event, dayDelta, revertFunc) {
@@ -573,8 +577,10 @@ define([
573577
}
574578
}));
575579
} else {
576-
views.push(this.defaultView);
577-
this._views[this.defaultView] = {};
580+
var viewName = this.defaultView;
581+
582+
views.push(viewName);
583+
this._views[viewName] = {};
578584

579585
if (this.titleFormat) {
580586
this._views[viewName].titleFormat = this.titleFormat;
@@ -772,7 +778,12 @@ define([
772778
}
773779
},
774780

775-
_onEventAfterAllRender: function() {
781+
_onEventAfterAllRender: function(view) {
782+
if (view && (view.type === "agendaWeek" || view.type === "agendaDay")) {
783+
logger.debug(this.id + "._onEventAfterAllRender");
784+
view.applyDateScroll(view.computeInitialDateScroll()); // fixing issue with initial scrolltime (https://github.com/mendix/Calendar/issues/45)
785+
}
786+
776787
// if (!this._triggeredRenderAll) {
777788
// logger.debug(this.id + "._onEventAfterAllRender");
778789
// this._triggeredRenderAll = true;

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Calendar" version="5.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Calendar" version="5.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="calendar/calendar.xml"/>
66
<widgetFile path="calendar/calendar-scheduler.xml"/>

test/[Test] Calendar Widget.mpr

101 KB
Binary file not shown.

test/widgets/calendar.mpk

102 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)