Skip to content

Commit

Permalink
Fix #45 - scrolltime for AgendaWeek & AgendaDay
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelte Lagendijk committed Nov 2, 2017
1 parent 81eb1ea commit 26fcda2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendar",
"version": "5.3.0",
"version": "5.3.1",
"description": "This is a calendar widget for Mendix. It shows a Calendar and can render objects as events in it.",
"license": "Apache License, Version 2.0, January 2004",
"author": "Mendix 2016",
Expand Down
19 changes: 15 additions & 4 deletions src/calendar/widget/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ define([
this._fcNode.fullCalendar("render");
this._fcNode.fullCalendar("refetchEvents");
this._timeout = null;
}), 100);
}), 50);
},

_setSchedulerOptions: function(options) {
Expand Down Expand Up @@ -431,6 +431,10 @@ define([
} else {
this._fcNode.fullCalendar("gotoDate", new Date());
}

window._refreshCal = lang.hitch(this, function () {
this._fcNode.fullCalendar("refetchEvents");
});
},

_onEventChange: function(event, dayDelta, revertFunc) {
Expand Down Expand Up @@ -573,8 +577,10 @@ define([
}
}));
} else {
views.push(this.defaultView);
this._views[this.defaultView] = {};
var viewName = this.defaultView;

views.push(viewName);
this._views[viewName] = {};

if (this.titleFormat) {
this._views[viewName].titleFormat = this.titleFormat;
Expand Down Expand Up @@ -772,7 +778,12 @@ define([
}
},

_onEventAfterAllRender: function() {
_onEventAfterAllRender: function(view) {
if (view && (view.type === "agendaWeek" || view.type === "agendaDay")) {
logger.debug(this.id + "._onEventAfterAllRender");
view.applyDateScroll(view.computeInitialDateScroll()); // fixing issue with initial scrolltime (https://github.com/mendix/Calendar/issues/45)
}

// if (!this._triggeredRenderAll) {
// logger.debug(this.id + "._onEventAfterAllRender");
// this._triggeredRenderAll = true;
Expand Down
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="Calendar" version="5.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="Calendar" version="5.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="calendar/calendar.xml"/>
<widgetFile path="calendar/calendar-scheduler.xml"/>
Expand Down
Binary file modified test/[Test] Calendar Widget.mpr
Binary file not shown.
Binary file modified test/widgets/calendar.mpk
Binary file not shown.

0 comments on commit 26fcda2

Please sign in to comment.