Skip to content

Commit 1656eef

Browse files
author
Jelte Lagendijk
committed
Fix Calendar in tab container
1 parent efe1f94 commit 1656eef

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/calendar/widget/calendar.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ define([
4444
_allowCreate: true,
4545
_shouldDestroyOnUpdate: false,
4646
_triggeredRenderAll: false,
47+
_timeout: null,
4748

4849
postCreate: function() {
4950
logger.debug(this.id + ".postCreate");
@@ -86,8 +87,17 @@ define([
8687
},
8788

8889
resize: function() {
89-
logger.debug(this.id + ".resize");
90-
this._fcNode.fullCalendar("render");
90+
if (this._timeout !== null) {
91+
clearTimeout(this._timeout);
92+
this._timeout = null;
93+
}
94+
95+
this._timeout = setTimeout(lang.hitch(this, function() {
96+
logger.debug(this.id + ".resize");
97+
this._fcNode.fullCalendar("render");
98+
this._fcNode.fullCalendar("refetchEvents");
99+
this._timeout = null;
100+
}), 100);
91101
},
92102

93103
_setSchedulerOptions: function(options) {
@@ -537,8 +547,8 @@ define([
537547

538548
this._views[viewName] = {};
539549

540-
var viewLimit = parseInt(view.eventLimit);
541-
if (!isNaN(viewLimit) && viewLimit > 0) {
550+
var eventLimit = parseInt(view.eventLimit);
551+
if (!isNaN(eventLimit) && eventLimit > 0) {
542552
this._views[viewName].eventLimit = eventLimit;
543553
}
544554

@@ -826,10 +836,7 @@ define([
826836
// thus require a destroy action
827837
_hasDynamicCalendarPropertiesConfigured: function() {
828838
logger.debug(this.id + "._hasDynamicCalendarPropertiesConfigured");
829-
if (this.showWeekendsAttribute && this.firstdayAttribute) {
830-
return true;
831-
}
832-
return false;
839+
return this.showWeekendsAttribute && this.firstdayAttribute;
833840
},
834841

835842
uninitialize: function() {

test/[Test] Calendar Widget.mpr

26 KB
Binary file not shown.

test/widgets/calendar.mpk

43 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)