define(["require", "exports", "../renderer/nonworking-day", "../renderer/event-marker", "@syncfusion/ej2-base"], function (require, exports, nonworking_day_1, event_marker_1, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var DayMarkers = (function () {
function DayMarkers(parent) {
this.parent = parent;
this.nonworkingDayRender = new nonworking_day_1.NonWorkingDay(this.parent);
this.eventMarkerRender = new event_marker_1.EventMarker(this.parent);
this.wireEvents();
}
DayMarkers.prototype.wireEvents = function () {
this.parent.on('refreshDayMarkers', this.refreshMarkers, this);
this.parent.on('updateHeight', this.updateHeight, this);
this.parent.on('ui-update', this.propertyChanged, this);
};
DayMarkers.prototype.propertyChanged = function (property) {
var keys = Object.keys(ej2_base_1.getValue('properties', property));
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
switch (key) {
case 'eventMarkers':
this.eventMarkerRender.renderEventMarkers();
this.updateHeight();
break;
case 'highlightWeekends':
this.nonworkingDayRender.renderWeekends();
this.updateHeight();
break;
case 'holidays':
this.nonworkingDayRender.renderHolidays();
this.updateHeight();
break;
}
}
};
DayMarkers.prototype.refreshMarkers = function () {
this.nonworkingDayRender.renderWeekends();
this.nonworkingDayRender.renderHolidays();
if (this.parent.gridLines === 'Vertical' || this.parent.gridLines === 'Both') {
this.parent['renderChartVerticalLines']();
}
this.eventMarkerRender.renderEventMarkers();
};
DayMarkers.prototype.updateHeight = function () {
this.nonworkingDayRender.updateContainerHeight();
this.eventMarkerRender.updateContainerHeight();
};
DayMarkers.prototype.getModuleName = function () {
return 'dayMarkers';
};
DayMarkers.prototype.destroy = function () {
if (this.parent.isDestroyed) {
return;
}
this.nonworkingDayRender.removeContainers();
this.eventMarkerRender.removeContainer();
this.parent.off('refreshDayMarkers', this.refreshMarkers);
this.parent.off('updateHeight', this.updateHeight);
this.parent.off('ui-update', this.propertyChanged);
};
return DayMarkers;
}());
exports.DayMarkers = DayMarkers;
});
|