forked from damiengarbarino/dojo-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabelRenderer.js
48 lines (40 loc) · 915 Bytes
/
LabelRenderer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
define([
"dcl/dcl",
"delite/register",
"./RendererBase",
"delite/handlebars!./templates/LabelRenderer.html"
], function (
dcl,
register,
_RendererMixin,
template
) {
return register("d-calendar-label", [HTMLElement, _RendererMixin], {
// summary:
// The default item label renderer.
template: template,
_orientation: "horizontal",
resizeEnabled: false,
visibilityLimits: {
resizeStartHandle: 50,
resizeEndHandle: -1,
summaryLabel: 15,
startTimeLabel: 45,
endTimeLabel: 30
},
_isElementVisible: dcl.superCall(function (sup) {
return function (elt) {
switch (elt) {
case "startTimeLabel":
// hide hour part of all day events on subsequent days
if (this.item.allDay && +this.item.range[0] !== +this.item.startTime) {
return false;
}
break;
}
return sup.apply(this, arguments);
};
}),
_displayValue: "inline"
});
});